CWE-179
Incorrect Behavior Order: Early Validation
Description
The product validates input before applying protection mechanisms that modify the input.
Consequences
Access Control, Integrity
—
Bypass Protection Mechanism, Execute Unauthorized Code or Commands
An attacker could bypass the protection mechanism by including dangerous inputs that are only produced after the modification (such as canonicalization and cleansing). This can be used to launch various attacks including injection, executing arbitrary code, or causing other unintended behavior.
Mitigations
Phase: Implementation
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.