deny list
A list of known-bad values to reject, with everything else accepted.
In more detail
Deny lists lose against attackers, who have comment markers, alternate encodings, case tricks, whitespace and nesting, while you have a list written on a Tuesday afternoon. Prefer parameters and allowlists.
Example
Stripping ; and | from an argument before eval is a deny list; passing the value as its own quoted argument is the fix.Related terms
- command injection — An attack where input meant as data, such as a file name or form field, gets run as commands because a program built code from it.
- untrusted input — Any data a program did not create itself, including arguments, form fields, request bodies, file contents, file names and environment variables.
Taught in
- eval, And What To Use Instead — Bash Scripting & Command Line Automation