CAPECattack pattern

CAPEC-71 Using Unicode Encoding to Bypass Validation Logic

High Official page ↗
Abstraction
Detailed
Status
Draft
Likelihood of attack
Medium
Typical severity
High
CAPEC version
3.9

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.

Execution flow

1. [Explore] [Survey the application for user-controllable inputs] Using a browser or an automated tool, an attacker follows all public links and actions on a web site. They record all the links, the forms, the resources accessed and all other potential entry-points for the web application. 2. [Experiment] [Probe entry points to locate vulnerabilities] The attacker uses the entry points gathered in the "Explore" phase as a target list and injects various Unicode encoded payloads to determine if an entry point actually represents a vulnerability with insufficient validation logic and to characterize the extent to which the vulnerability can be exploited.

Prerequisites

• Filtering is performed on data that has not be properly canonicalized.

Skills required

• [Medium] An 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

• Confidentiality, Access Control, Authorization: Bypass Protection Mechanism • Confidentiality, Integrity, Availability: Execute Unauthorized Commands • 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

Child of · CAPEC (1)

  • CAPEC-267 Leverage Alternate Encoding attack pattern

Weakness · CWE (11)

  • CWE-172 Improper Encoding or Decoding of Data weakness
  • CWE-173 Improper Handling of Alternate Encoding weakness
  • CWE-176 Improper Handling of Unicode Encoding weakness
  • CWE-179 Incorrect Behavior Order: Early Validation weakness
  • CWE-180 Incorrect Behavior Order: Validate Before Canonicalize weakness
  • CWE-183 Permissive List of Allowed Inputs weakness
  • CWE-184 Incomplete List of Disallowed Inputs weakness
  • CWE-20 Improper Input Validation weakness
  • CWE-692 Incomplete Denylist to Cross-Site Scripting weakness
  • CWE-697 Incorrect Comparison weakness
  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component weakness

Referenced by CAPEC · peer of (1)

  • CAPEC-80 Using UTF-8 Encoding to Bypass Validation Logic attack pattern

Referenced by CWE · attack pattern (11)

  • CWE-172 Improper Encoding or Decoding of Data weakness
  • CWE-173 Improper Handling of Alternate Encoding weakness
  • CWE-176 Improper Handling of Unicode Encoding weakness
  • CWE-179 Incorrect Behavior Order: Early Validation weakness
  • CWE-180 Incorrect Behavior Order: Validate Before Canonicalize weakness
  • CWE-183 Permissive List of Allowed Inputs weakness
  • CWE-184 Incomplete List of Disallowed Inputs weakness
  • CWE-20 Improper Input Validation weakness
  • CWE-692 Incomplete Denylist to Cross-Site Scripting weakness
  • CWE-697 Incorrect Comparison weakness
  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component weakness