This vulnerability occurs when an application accepts external input but fails to properly sanitize special characters or syntax that have specific meanings in the target interpreter or protocol. This allows attackers to inject control elements that alter how downstream components process the data.
Programming languages, command shells, databases, and network protocols all use special characters and reserved words as syntactic markers—like quotes, angle brackets, or escape sequences—to define commands or structure data. When an application passes unsanitized user input containing these elements to an interpreter, the interpreter may execute unintended actions, such as reading a file, terminating a command, or altering a query. For example, the `<` character is interpreted by many shells as a directive to read input from a file, while SQL uses the single quote (`'`) to delimit strings. Without proper neutralization (often called sanitization or escaping), an attacker can break out of the intended data context and inject malicious instructions, leading to data breaches, system compromise, or unexpected application behavior.
Impact: Execute Unauthorized Code or CommandsAlter Execution LogicDoS: Crash, Exit, or Restart
Strategy: Input Validation
Strategy: Input Validation
Strategy: Output Encoding