418
validation. However, denylists can be useful for detecting potential attacks or determining which
inputs are so malformed that they should be rejected outright.
Phase: Implementation
Strategy = Output Encoding
While it is risky to use dynamically-generated query strings, code, or commands that mix control
and data together, sometimes it may be unavoidable. Properly quote arguments and escape
any special characters within those arguments. The most conservative approach is to escape or
filter all characters that do not pass an extremely strict allowlist (such as everything that is not
alphanumeric or white space). If some special characters are still needed, such as white space,
wrap each argument in quotes after the escaping/filtering step. Be careful of argument injection
(CWE-88).
Phase: Implementation
Strategy = Input Validation
Inputs should be decoded and canonicalized to the application's current internal representation
before being validated (CWE-180). Make sure that the application does not decode the same
input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by
introducing dangerous inputs after they have been checked.
Observed Examples
Reference Description
CVE-2004-0847 web framework for .NET allows remote attackers to bypass authentication
for .aspx files in restricted directories via a request containing a (1)
"\" (backslash) or (2) "%5C" (encoded backslash)
https://www.cve.org/CVERecord?id=CVE-2004-0847
CVE-2002-1451 Trailing space ("+" in query string) leads to source code disclosure.
https://www.cve.org/CVERecord?id=CVE-2002-1451
CVE-2001-0446 Application server allows remote attackers to read source code for .jsp files by
appending a / to the requested URL.
https://www.cve.org/CVERecord?id=CVE-2001-0446
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 990 SFP Secondary Cluster: Tainted Input to Command 888 2413
MemberOf 1407 Comprehensive Categorization: Improper Neutralization 1400 2532
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
PLOVER Trailing Special Element
Software Fault Patterns SFP24 Tainted input to command
Related Attack Patterns
CAPEC-ID Attack Pattern Name
635 Alternative Execution Due to Deceptive Filenames
CWE-163: Improper Neutralization of Multiple Trailing Special Elements
Weakness ID : 163
Structure : Simple
CWE Version 4.14
CWE-163: Improper Neutralization of Multiple Trailing Special Elements
CWE-163: Improper Neutralization of Multiple Trailing Special Elements