This vulnerability occurs when an application accepts user input and fails to properly sanitize special characters that can trigger command or variable substitution before passing that data to another system component. This allows attackers to inject malicious substitutions that alter the system's intended behavior.
At its core, this flaw is about a broken data pipeline. An upstream component (like a user form, API, or file upload) sends raw data containing characters like backticks (`), dollar signs ($), or percent signs (%), which many systems interpret as instructions to execute a command or expand a variable. The vulnerable component acts as a passive conduit, forwarding this tainted data without cleaning it, effectively letting user input dictate actions in the downstream component. For developers, the fix involves implementing strict input validation and context-aware output encoding. Treat all incoming data as untrusted and neutralize substitution characters based on exactly how the downstream component will use the data. For example, if passing data to a shell, escape shell metacharacters; if passing to a script engine, escape its specific substitution syntax. Never rely on blacklists; instead, use allowlists of expected safe characters or robust encoding libraries designed for the target interpreter.
Impact: Unexpected State
Strategy: Input Validation
Strategy: Output Encoding
Strategy: Input Validation