CAPECattack pattern
CAPEC-267 Leverage Alternate Encoding
High
Official page ↗
- Abstraction
- Standard
- Status
- Draft
- Likelihood of attack
- High
- Typical severity
- High
- CAPEC version
- 3.9
Description
An adversary leverages the possibility to encode potentially harmful input or content used by applications such that the applications are ineffective at validating this encoding standard.
Execution flow
1. [Explore] [Survey the application for user-controllable inputs] Using a browser, an automated tool or by inspecting the application, an adversary records all entry points to the application.
2. [Experiment] [Probe entry points to locate vulnerabilities] The adversary uses the entry points gathered in the "Explore" phase as a target list and injects various payloads using a variety of different types of encodings 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
• The application's decoder accepts and interprets encoded characters. Data canonicalization, input filtering and validating is not done properly leaving the door open to harmful characters for the target host.
Skills required
• [Low] An adversary can inject different representation of a filtered character in a different encoding.
• [Medium] An adversary may craft subtle encoding of input data by using the knowledge that they have gathered about the target host.
Consequences
• Integrity: Modify Data
• Confidentiality: Read Data
• Authorization: Execute Unauthorized Commands
• Accountability, Authentication, Authorization, Non-Repudiation: Gain Privileges
• Access Control, Authorization: Bypass Protection Mechanism
• Availability: Unreliable Execution, Resource Consumption
Mitigations
• Assume all input might use an improper representation. Use canonicalized data inside the application; all data must be converted into the representation used inside the application (UTF-8, UTF-16, etc.)
• 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. Test your decoding process against malicious input.
Related
Att&ck technique · MITRE ATT&CK (1)
- T1027 Obfuscated Files or Information technique
Child of · CAPEC (1)
- CAPEC-153 Input Data Manipulation attack pattern
Weakness · CWE (9)
- CWE-172 Improper Encoding or Decoding of Data weakness
- CWE-173 Improper Handling of Alternate Encoding weakness
- CWE-180 Incorrect Behavior Order: Validate Before Canonicalize weakness
- CWE-181 Incorrect Behavior Order: Validate Before Filter weakness
- CWE-20 Improper Input Validation weakness
- CWE-692 Incomplete Denylist to Cross-Site Scripting weakness
- CWE-697 Incorrect Comparison weakness
- CWE-73 External Control of File Name or Path weakness
- CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component weakness
Referenced by CAPEC · child of (12)
- CAPEC-120 Double Encoding attack pattern
- CAPEC-3 Using Leading 'Ghost' Character Sequences to Bypass Input Filters attack pattern
- CAPEC-4 Using Alternative IP Address Encodings attack pattern
- CAPEC-43 Exploiting Multiple Input Interpretation Layers attack pattern
- CAPEC-52 Embedding NULL Bytes attack pattern
- CAPEC-53 Postfix, Null Terminate, and Backslash attack pattern
- CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic attack pattern
- CAPEC-71 Using Unicode Encoding to Bypass Validation Logic attack pattern
- CAPEC-72 URL Encoding attack pattern
- CAPEC-78 Using Escaped Slashes in Alternate Encoding attack pattern
- CAPEC-79 Using Slashes in Alternate Encoding attack pattern
- CAPEC-80 Using UTF-8 Encoding to Bypass Validation Logic attack pattern
Referenced by CWE · attack pattern (9)
- CWE-172 Improper Encoding or Decoding of Data weakness
- CWE-173 Improper Handling of Alternate Encoding weakness
- CWE-180 Incorrect Behavior Order: Validate Before Canonicalize weakness
- CWE-181 Incorrect Behavior Order: Validate Before Filter weakness
- CWE-20 Improper Input Validation weakness
- CWE-692 Incomplete Denylist to Cross-Site Scripting weakness
- CWE-697 Incorrect Comparison weakness
- CWE-73 External Control of File Name or Path weakness
- CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component weakness