375
malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if
the code's environment changes. This can give attackers enough room to bypass the intended
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
Use and specify an appropriate output encoding to ensure that the special elements are welldefined.
A normal byte sequence in one encoding could be a special element in another.
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.
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).
Observed Examples
Reference Description
CVE-2001-0677 Read arbitrary files from mail client by providing a special MIME header that is
internally used to store pathnames for attachments.
https://www.cve.org/CVERecord?id=CVE-2001-0677
CVE-2000-0703 Setuid program does not cleanse special escape sequence before sending
data to a mail program, causing the mail program to process those sequences.
https://www.cve.org/CVERecord?id=CVE-2000-0703
CVE-2003-0020 Multi-channel issue. Terminal escape sequences not filtered from log files.
https://www.cve.org/CVERecord?id=CVE-2003-0020
CVE-2003-0083 Multi-channel issue. Terminal escape sequences not filtered from log files.
https://www.cve.org/CVERecord?id=CVE-2003-0083
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 1347 OWASP Top Ten 2021 Category A03:2021 - Injection 1344 2490
MemberOf 1407 Comprehensive Categorization: Improper Neutralization 1400 2532
Notes
Relationship
This weakness can be related to interpretation conflicts or interaction errors in intermediaries
(such as proxies or application firewalls) when the intermediary's model of an endpoint does not
account for protocol-specific special elements.
CWE Version 4.14
CWE-140: Improper Neutralization of Delimiters
CWE-140: Improper Neutralization of Delimiters