Dark Mode
Capec-43 Detail
Exploiting Multiple Input Interpretation Layers
Detailed Software Likelihood: Medium Typical Severity: High
Parents: 267
Threats: T62 T290 T291
Not present
| External ID | Source | Link | Description |
|---|---|---|---|
| CAPEC-43 | capec | https://capec.mitre.org/data/definitions/43.html | |
| CWE-179 | cwe | http://cwe.mitre.org/data/definitions/179.html | |
| CWE-181 | cwe | http://cwe.mitre.org/data/definitions/181.html | |
| CWE-184 | cwe | http://cwe.mitre.org/data/definitions/184.html | |
| CWE-183 | cwe | http://cwe.mitre.org/data/definitions/183.html | |
| CWE-77 | cwe | http://cwe.mitre.org/data/definitions/77.html | |
| CWE-78 | cwe | http://cwe.mitre.org/data/definitions/78.html | |
| CWE-74 | cwe | http://cwe.mitre.org/data/definitions/74.html | |
| CWE-20 | cwe | http://cwe.mitre.org/data/definitions/20.html | |
| CWE-697 | cwe | http://cwe.mitre.org/data/definitions/697.html | |
| CWE-707 | cwe | http://cwe.mitre.org/data/definitions/707.html | |
| REF-1 | reference_from_CAPEC | G. Hoglund, G. McGraw, Exploiting Software: How to Break Code, 2004--02, Addison-Wesley |
Explore
-
Determine application/system inputs where bypassing input validation is desired: The attacker first needs to determine all of the application's/system's inputs where input validation is being performed and where they want to bypass it.
| Techniques |
|---|
| While using an application/system, the attacker discovers an input where validation is stopping them from performing some malicious or unauthorized actions. |
Experiment
-
Determine which character encodings are accepted by the application/system: The attacker then needs to provide various character encodings to the application/system and determine which ones are accepted. The attacker will need to observe the application's/system's response to the encoded data to determine whether the data was interpreted properly.
-
Combine multiple encodings accepted by the application.: The attacker now combines encodings accepted by the application. The attacker may combine different encodings or apply the same encoding multiple times.
| Techniques |
|---|
| Determine which escape characters are accepted by the application/system. A common escape character is the backslash character, '\' |
| Determine whether URL encoding is accepted by the application/system. |
| Determine whether UTF-8 encoding is accepted by the application/system. |
| Determine whether UTF-16 encoding is accepted by the application/system. |
| Determine if any other encodings are accepted by the application/system. |
| Techniques |
|---|
| Combine same encoding multiple times and observe its effects. For example, if special characters are encoded with a leading backslash, then the following encoding may be accepted by the application/system: "\\\.". With two parsing layers, this may get converted to "\." after the first parsing layer, and then, to "." after the second. If the input validation layer is between the two parsing layers, then "\\\.\\\." might pass a test for ".." but still get converted to ".." afterwards. This may enable directory traversal attacks. |
| Combine multiple encodings and observe the effects. For example, the attacker might encode "." as "\.", and then, encode "\." as "\.", and then, encode that using URL encoding to "%26%2392%3B%26%2346%3B" |
Exploit
-
Leverage ability to bypass input validation: Attacker leverages their ability to bypass input validation to gain unauthorized access to system. There are many attacks possible, and a few examples are mentioned here.
| Techniques |
|---|
| Gain access to sensitive files. |
| Perform command injection. |
| Perform SQL injection. |
| Perform XSS attacks. |
- User input is used to construct a command to be executed on the target system or as part of the file name.
- Multiple parser passes are performed on the data supplied by the user.
Not present
| Medium |
|---|
| Knowledge of various escaping schemes, such as URL escape encoding and XML escape characters. |
| Integrity | Authorization | Access Control | Confidentiality |
|---|---|---|---|
| Modify Data | Gain Privileges | Gain Privileges | Gain Privileges |
| Read Data |
- The backslash character provides a good example of the multiple-parser issue. A backslash is used to escape characters in strings, but is also used to delimit directories on the NT file system. When performing a command injection that includes NT paths, there is usually a need to "double escape" the backslash. In some cases, a quadruple escape is necessary. Original String: C:\\\\\\\winnt\\\\\\\system32\\\\\\\cmd.exe /c Interim String: C:\\\winnt\\\system32\\\cmd.exe /c Final String: C:\winnt\system32\cmd.exe /c This diagram shows each successive layer of parsing translating the backslash character. A double backslash becomes a single as it is parsed. By using quadruple backslashes, the attacker is able to control the result in the final string. [REF-1]