Dark Mode
Capec-3 Detail
Using Leading 'Ghost' Character Sequences to Bypass Input Filters
Detailed Software Likelihood: Medium Typical Severity: Medium
Parents: 267
Threats: T62 T290 T291
Not present
| External ID | Source | Link | Description |
|---|---|---|---|
| CAPEC-3 | capec | https://capec.mitre.org/data/definitions/3.html | |
| CWE-173 | cwe | http://cwe.mitre.org/data/definitions/173.html | |
| CWE-41 | cwe | http://cwe.mitre.org/data/definitions/41.html | |
| CWE-172 | cwe | http://cwe.mitre.org/data/definitions/172.html | |
| CWE-179 | cwe | http://cwe.mitre.org/data/definitions/179.html | |
| CWE-180 | cwe | http://cwe.mitre.org/data/definitions/180.html | |
| CWE-181 | cwe | http://cwe.mitre.org/data/definitions/181.html | |
| CWE-183 | cwe | http://cwe.mitre.org/data/definitions/183.html | |
| CWE-184 | cwe | http://cwe.mitre.org/data/definitions/184.html | |
| CWE-20 | cwe | http://cwe.mitre.org/data/definitions/20.html | |
| CWE-74 | cwe | http://cwe.mitre.org/data/definitions/74.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
-
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.
| Techniques |
|---|
| Use a spidering tool to follow and record all links and analyze the web pages to find entry points. Make special note of any links that include parameters in the URL. |
| Use a proxy tool to record all user input entry points visited during a manual traversal of the web application. |
| Use a browser to manually explore the website and analyze how it is constructed. Many browsers' plugins are available to facilitate the analysis or automate the discovery. |
| Manually inspect the application to find entry points. |
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 leading 'Ghost' character sequences to determine how to application filters them.
| Techniques |
|---|
| Add additional characters to common sequences such as "../" to see how the application will filter them. |
| Try repeating special characters (?, @, #, *, etc.) at the beginning of user input to see how the application filters these out. |
Exploit
-
Bypass input filtering: Using what the adversary learned about how the application filters input data, they craft specific input data that bypasses the filter. This can lead to directory traversal attacks, arbitrary shell command execution, corruption of files, etc.
- The targeted API must ignore the leading ghost characters that are used to get past the filters for the semantics to be the same.
Not present
| Medium |
|---|
| The ability to make an API request, and knowledge of "ghost" characters that will not be filtered by any input validation. These "ghost" characters must be known to not affect the way in which the request will be interpreted. |
| Integrity | Authorization | Access Control | Confidentiality |
|---|---|---|---|
| Modify Data | Gain Privileges | Gain Privileges | Gain Privileges |
- Alternate Encoding with Ghost Characters in FTP and Web Servers Some web and FTP servers fail to detect prohibited upward directory traversals if the user- supplied pathname contains extra characters such as an extra leading dot. For example, a program that will disallow access to the pathname "../test.txt" may erroneously allow access to that file if the pathname is specified as ".../test.txt". This attack succeeds because 1) the input validation logic fails to detect the triple-dot as a directory traversal attempt (since it isn't dot-dot), 2) some part of the input processing decided to strip off the "extra" dot, leaving the dot-dot behind. Using the file system API as the target, the following strings are all equivalent to many programs: .../../../test.txt............/../../test.txt..?/../../test.txt..????????/../../test.txt../test.txt As you can see, there are many ways to make a semantically equivalent request. All these strings ultimately result in a request for the file ../test.txt.