This vulnerability occurs when an application decodes the same piece of data twice in sequence. This double processing can bypass or neutralize security checks that happen after the first decode, leaving the system exposed.
Double decoding is dangerous because it breaks the expected data flow. Security mechanisms like input validation, sanitization, or intrusion detection are often placed after an initial decoding step, assuming the data is now in its canonical form. When a second, unexpected decode happens, it can transform the data again, rendering those intermediate protections useless and allowing malicious payloads to slip through. Developers can prevent this by establishing a strict, one-time decoding policy in a centralized location within the application's data pipeline. All incoming data should be decoded, validated, and sanitized once into a trusted, internal format before being passed to other components. This ensures security controls are applied to the final, operational form of the data and cannot be circumvented by further transformations.
Impact: Bypass Protection MechanismExecute Unauthorized Code or CommandsVaries by Context
Strategy: Input Validation
Strategy: Input Validation
Strategy: Output Encoding
Strategy: Input Validation