Block Lists

A block list (formerly "blacklist") is a list of values that a system explicitly refuses, such as banned IP addresses, file extensions or words.

Block lists are easy to write and hard to get right, because an attacker only needs to find one dangerous value that you forgot. Consider a web application that fetches URLs on a user's behalf, and tries to stop server-side request forgery by refusing any URL that contains localhost or 127.0.0.1. An attacker can reach the same machine with 127.1, 0.0.0.0, [::1], the decimal form 2130706433, or a domain name of their own that resolves to 127.0.0.1. Each of these sails straight past the block list.

Where you can, use an allow list instead, which names the values you accept and refuses everything else. Block lists still have a place for things that cannot be listed in advance, such as known-malicious IP addresses or common passwords, but treat them as one layer of defense in depth.

Further Reading

Learn it hands-on

An attacker can use SSRF vulnerabilities to probe your internal network.