CWE-181: Incorrect Behavior Order: Validate Before Filter
Description
The product validates data before it has been filtered, which prevents the product from detecting data that becomes invalid after the filtering step.
This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.
- Abstraction
- VariantA weakness tied to a specific language, technology or resource.
- Likelihood of exploit
- Not rated by MITRE
- Status
- Draft
Common consequences
- Access Control
Bypass Protection Mechanism
Potential mitigations
- ImplementationArchitecture and Design
Inputs should be decoded and canonicalized to the application's current internal representation before being filtered.
Related weaknesses
Parent weaknesses
CAPEC attack patterns that exploit it
- CAPEC-3Using Leading 'Ghost' Character Sequences to Bypass Input Filters
- CAPEC-43Exploiting Multiple Input Interpretation Layers
- CAPEC-78Using Escaped Slashes in Alternate Encoding
- CAPEC-79Using Slashes in Alternate Encoding
- CAPEC-80Using UTF-8 Encoding to Bypass Validation Logic
- CAPEC-120Double Encoding
- CAPEC-267Leverage Alternate Encoding