CAPEC-71: Using Unicode Encoding to Bypass Validation Logic
Description
An attacker may provide a Unicode string to a system component that is not Unicode aware and use that to circumvent the filter or cause the classifying mechanism to fail to properly understanding the request. That may allow the attacker to slip malicious data past the content filter and/or possibly cause the application to route the request incorrectly.
- Likelihood of attack
- Medium
- Typical severity
- High
- Abstraction
- DetailedA low-level, detailed pattern, often for a particular technology.
Mechanism of attack: Manipulate Data Structures
Prerequisites
- Filtering is performed on data that has not be properly canonicalized.
Skills required
- MediumAn attacker needs to understand Unicode encodings and have an idea (or be able to find out) what system components may not be Unicode aware.
Consequences
- ConfidentialityAccess ControlAuthorization
Bypass Protection Mechanism
- ConfidentialityIntegrityAvailability
Execute Unauthorized Commands
Run Arbitrary Code
- Integrity
Modify Data
- Availability
Unreliable Execution
Mitigations
- Ensure that the system is Unicode aware and can properly process Unicode data. Do not make an assumption that data will be in ASCII.
- Ensure that filtering or input validation is applied to canonical data.
- Assume all input is malicious. Create an allowlist that defines all valid input to the software system based on the requirements specifications. Input that does not match against the allowlist should not be permitted to enter into the system.
Related weaknesses (CWE)
- CWE-20Improper Input Validation
- CWE-74Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
- CWE-172Encoding Error
- CWE-173Improper Handling of Alternate Encoding
- CWE-176Improper Handling of Unicode Encoding
- CWE-179Incorrect Behavior Order: Early Validation
- CWE-180Incorrect Behavior Order: Validate Before Canonicalize
- CWE-183Permissive List of Allowed Inputs
- CWE-184Incomplete List of Disallowed Inputs
- CWE-692Incomplete Denylist to Cross-Site Scripting
- CWE-697Incorrect Comparison