CWE-154 – Improper Neutralization of Variable Name Delimiters

Read Time:1 Minute, 32 Second

Description

The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as variable name delimiters when they are sent to a downstream component.

As data is parsed, an injected delimiter may cause the process to take unexpected actions that result in an attack. Example: “$” for an environment variable.

Modes of Introduction:

– Implementation

 

 

Related Weaknesses

CWE-138

 

Consequences

Integrity: Unexpected State

 

Potential Mitigations

Phase:

Description: 

Developers should anticipate that variable name delimiters will be injected/removed/manipulated in the input vectors of their software system. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.

Phase: Implementation

Description: 

Phase: Implementation

Description: 

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

Description: 

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.

CVE References

  • CVE-2005-0129
    • “%” variable is expanded by wildcard function into disallowed commands.
  • CVE-2002-0770
    • Server trusts client to expand macros, allows macro characters to be expanded to trigger resultant information exposure.

CWE-153 – Improper Neutralization of Substitution Characters

Read Time:1 Minute, 20 Second

Description

The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as substitution characters when they are sent to a downstream component.

Modes of Introduction:

– Implementation

 

 

Related Weaknesses

CWE-138

 

Consequences

Integrity: Unexpected State

 

Potential Mitigations

Phase:

Description: 

Developers should anticipate that substitution characters will be injected/removed/manipulated in the input vectors of their software system. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.

Phase: Implementation

Description: 

Phase: Implementation

Description: 

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

Description: 

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.

CVE References

  • CVE-2002-0770
    • Server trusts client to expand macros, allows macro characters to be expanded to trigger resultant information exposure.

CWE-152 – Improper Neutralization of Macro Symbols

Read Time:1 Minute, 37 Second

Description

The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as macro symbols when they are sent to a downstream component.

Modes of Introduction:

– Implementation

 

 

Related Weaknesses

CWE-138

 

Consequences

Integrity: Unexpected State

 

Potential Mitigations

Phase: Implementation

Description: 

Developers should anticipate that macro symbols will be injected/removed/manipulated in the input vectors of their software system. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.

Phase: Implementation

Description: 

Phase: Implementation

Description: 

Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.

Phase: Implementation

Description: 

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.

CVE References

  • CVE-2002-0770
    • Server trusts client to expand macros, allows macro characters to be expanded to trigger resultant information exposure.
  • CVE-2008-2018
    • Attacker can obtain sensitive information from a database by using a comment containing a macro, which inserts the data during expansion.

CWE-151 – Improper Neutralization of Comment Delimiters

Read Time:1 Minute, 45 Second

Description

The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as comment delimiters when they are sent to a downstream component.

Modes of Introduction:

– Implementation

 

 

Related Weaknesses

CWE-138

 

Consequences

Integrity: Unexpected State

 

Potential Mitigations

Phase:

Description: 

Developers should anticipate that comments will be injected/removed/manipulated in the input vectors of their software system. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.

Phase: Implementation

Description: 

Phase: Implementation

Description: 

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

Description: 

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.

CVE References

  • CVE-2002-0001
    • Mail client command execution due to improperly terminated comment in address list.
  • CVE-2004-0162
    • MIE. RFC822 comment fields may be processed as other fields by clients.
  • CVE-2005-1909
    • Information hiding using a manipulation involving injection of comment code into product. Note: these vulnerabilities are likely vulnerable to more general XSS problems, although a regexp might allow “>!–” while denying most other tags.
  • CVE-2005-1969
    • Information hiding using a manipulation involving injection of comment code into product. Note: these vulnerabilities are likely vulnerable to more general XSS problems, although a regexp might allow “

      CWE-150 – Improper Neutralization of Escape, Meta, or Control Sequences

      Read Time:2 Minute, 12 Second

      Description

      The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.

      As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.

      Modes of Introduction:

      – Implementation

       

       

      Related Weaknesses

      CWE-138

       

      Consequences

      Integrity: Unexpected State

       

      Potential Mitigations

      Phase:

      Description: 

      Developers should anticipate that escape, meta and control characters/sequences will be injected/removed/manipulated in the input vectors of their software system. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.

      Phase: Implementation

      Description: 

      Phase: Implementation

      Description: 

      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

      Description: 

      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.

      CVE References

      • CVE-2002-0542
        • The mail program processes special “~” escape sequence even when not in interactive mode.
      • CVE-2000-0703
        • Setuid program does not filter escape sequences before calling mail program.
      • CVE-2002-0986
        • Mail function does not filter control characters from arguments, allowing mail message content to be modified.
      • CVE-2003-0020
        • Multi-channel issue. Terminal escape sequences not filtered from log files.
      • CVE-2003-0083
        • Multi-channel issue. Terminal escape sequences not filtered from log files.
      • CVE-2003-0021
        • Terminal escape sequences not filtered by terminals when displaying files.
      • CVE-2003-0022
        • Terminal escape sequences not filtered by terminals when displaying files.
      • CVE-2003-0023
        • Terminal escape sequences not filtered by terminals when displaying files.
      • CVE-2003-0063
        • Terminal escape sequences not filtered by terminals when displaying files.
      • CVE-2000-0476
        • Terminal escape sequences not filtered by terminals when displaying files.
      • CVE-2001-1556
        • MFV. (multi-channel). Injection of control characters into log files that allow information hiding when using raw Unix programs to read the files.

      CWE-15 – External Control of System or Configuration Setting

      Read Time:52 Second

      Description

      One or more system settings or configuration elements can be externally controlled by a user.

      Allowing external control of system settings can disrupt service or cause an application to behave in unexpected, and potentially malicious ways.

      Modes of Introduction:

      – Implementation

       

       

      Related Weaknesses

      CWE-642
      CWE-610
      CWE-20

       

      Consequences

      Other: Varies by Context

       

      Potential Mitigations

      Phase: Architecture and Design

      Description: 

      Phase: Implementation, Architecture and Design

      Description: 

      Because setting manipulation covers a diverse set of functions, any attempt at illustrating it will inevitably be incomplete. Rather than searching for a tight-knit relationship between the functions addressed in the setting manipulation category, take a step back and consider the sorts of system values that an attacker should not be allowed to control.

      Phase: Implementation, Architecture and Design

      Description: 

      In general, do not allow user-provided or otherwise untrusted data to control sensitive values. The leverage that an attacker gains by controlling these values is not always immediately obvious, but do not underestimate the creativity of the attacker.

      CVE References

      CWE-149 – Improper Neutralization of Quoting Syntax

      Read Time:1 Minute, 29 Second

      Description

      Quotes injected into an application can be used to compromise a system. As data are parsed, an injected/absent/duplicate/malformed use of quotes may cause the process to take unexpected actions.

      Modes of Introduction:

      – Implementation

       

       

      Related Weaknesses

      CWE-138

       

      Consequences

      Integrity: Unexpected State

       

      Potential Mitigations

      Phase:

      Description: 

      Developers should anticipate that quotes will be injected/removed/manipulated in the input vectors of their software system. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.

      Phase: Implementation

      Description: 

      Phase: Implementation

      Description: 

      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

      Description: 

      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.

      CVE References

      • CVE-2004-0956
        • Database allows remote attackers to cause a denial of service (application crash) via a MATCH AGAINST query with an opening double quote but no closing double quote.
      • CVE-2003-1016
        • MIE. MFV too? bypass AV/security with fields that should not be quoted, duplicate quotes, missing leading/trailing quotes.

      CWE-148 – Improper Neutralization of Input Leaders

      Read Time:1 Minute, 13 Second

      Description

      The application does not properly handle when a leading character or sequence (“leader”) is missing or malformed, or if multiple leaders are used when only one should be allowed.

      Modes of Introduction:

      – Implementation

       

       

      Related Weaknesses

      CWE-138

       

      Consequences

      Integrity: Unexpected State

       

      Potential Mitigations

      Phase:

      Description: 

      Developers should anticipate that leading characters will be injected/removed/manipulated in the input vectors of their software system. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.

      Phase: Implementation

      Description: 

      Phase: Implementation

      Description: 

      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

      Description: 

      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.

      CVE References

      CWE-147 – Improper Neutralization of Input Terminators

      Read Time:1 Minute, 47 Second

      Description

      The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as input terminators when they are sent to a downstream component.

      For example, a “.” in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.

      Modes of Introduction:

      – Implementation

       

       

      Related Weaknesses

      CWE-138

       

      Consequences

      Integrity: Unexpected State

       

      Potential Mitigations

      Phase:

      Description: 

      Developers should anticipate that terminators will be injected/removed/manipulated in the input vectors of their software system. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.

      Phase: Implementation

      Description: 

      Phase: Implementation

      Description: 

      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

      Description: 

      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.

      CVE References

      • CVE-2000-0319
        • MFV. mail server does not properly identify terminator string to signify end of message, causing corruption, possibly in conjunction with off-by-one error.
      • CVE-2000-0320
        • MFV. mail server does not properly identify terminator string to signify end of message, causing corruption, possibly in conjunction with off-by-one error.
      • CVE-2001-0996
        • Mail server does not quote end-of-input terminator if it appears in the middle of a message.
      • CVE-2002-0001
        • Improperly terminated comment or phrase allows commands.

      CWE-146 – Improper Neutralization of Expression/Command Delimiters

      Read Time:1 Minute, 24 Second

      Description

      The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as expression or command delimiters when they are sent to a downstream component.

      As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.

      Modes of Introduction:

      – Implementation

       

       

      Related Weaknesses

      CWE-140

       

      Consequences

      Confidentiality, Integrity, Availability, Other: Execute Unauthorized Code or Commands, Alter Execution Logic

       

      Potential Mitigations

      Phase:

      Description: 

      Developers should anticipate that inter-expression and inter-command delimiters will be injected/removed/manipulated in the input vectors of their software system. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.

      Phase: Implementation

      Description: 

      Phase: Implementation

      Description: 

      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

      Description: 

      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.

      CVE References

News, Advisories and much more