This vulnerability occurs when a system uses one type of encoding for its output, but the component receiving that data expects a different encoding. The mismatch causes the downstream component to interpret the data incorrectly.
When the wrong encoding is applied, even if it's similar to the correct one, the receiving component may decode characters into unexpected control commands or special elements. This breaks the intended separation between data and executable instructions, potentially allowing injection attacks to bypass security checks like input validation. While common in web security—like using HTML entity encoding in a JavaScript context where it's ineffective—this issue can affect any system where data passes between components using different encoding rules. The core problem isn't a lack of encoding, but using encoding that doesn't match the context in which the data will be interpreted.
Impact: Modify Application DataExecute Unauthorized Code or Commands
An attacker could modify the structure of the message or data being sent to the downstream component, possibly injecting commands.
Strategy: Output Encoding
Strategy: Output Encoding
Strategy: Libraries or Frameworks
php
...*
phpbashhtml