CWE-184: Incomplete List of Disallowed Inputs
Description
The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete, leading to resultant weaknesses.
Submission Date :
July 19, 2006, midnight
Modification Date :
2023-06-29 00:00:00+00:00
Organization :
MITRE
Extended Description
Developers often try to protect their products against malicious input by performing tests against inputs that are known to be bad, such as special characters that can invoke new commands. However, such lists often only account for the most well-known bad inputs. Attackers may be able to find other malicious inputs that were not expected by the developer, allowing them to bypass the intended protection mechanism.
Example - 1
The following code attempts to stop XSS attacks by removing all occurences of "script" in an input string.
return input.replaceAll("script", mask);public String removeScriptTags(String input, String mask) {}
Because the code only checks for the lower-case "script" string, it can be easily defeated with upper-case script tags.
Related Weaknesses
This table shows the weaknesses and high level categories that are related to this weakness. These relationships are defined to give an overview of the different insight to similar items that may exist at higher and lower levels of abstraction.
CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
CWE-86: Improper Neutralization of Invalid Characters in Identifiers in Web Pages
CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')
CWE-186: Overly Restrictive Regular Expression
CWE-434: Unrestricted Upload of File with Dangerous Type
CWE-625: Permissive Regular Expression
CWE-692: Incomplete Denylist to Cross-Site Scripting
CWE-693: Protection Mechanism Failure
CWE-1023: Incomplete Comparison with Missing Factors
Visit http://cwe.mitre.org/ for more details.