CAPEC-79: Using Slashes in Alternate Encoding |
Description This attack targets the encoding of the Slash characters. An adversary would try to exploit common filtering problems related to the use of the slashes characters to gain access to resources on the target host. Directory-driven systems, such as file systems and databases, typically use the slash character to indicate traversal between directories or other container components. For murky historical reasons, PCs (and, as a result, Microsoft OSs) choose to use a backslash, whereas the UNIX world typically makes use of the forward slash. The schizophrenic result is that many MS-based systems are required to understand both forms of the slash. This gives the adversary many opportunities to discover and abuse a number of common filtering problems. The goal of this pattern is to discover server software that only applies filters to one version, but not the other. Likelihood Of Attack Typical Severity Execution Flow 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 looks for areas where user input is used to access resources on the target host. The adversary attempts different encodings of slash characters to bypass input filters. | Techniques |
|---|
| Try both backslash and forward slash characters | | Try different encodings for slash characters such as %5C |
Exploit Traverse application directories: Once the adversary determines how to bypass filters that filter out slash characters, they will manipulate the user input to include slashes in order to traverse directories and access resources that are not intended for the user.
Prerequisites
| The application server accepts paths to locate resources. |
| The application server does insufficient input data validation on the resource path requested by the user. |
| The access right to resources are not set properly. |
Skills Required
[Level: Low] An adversary can try variation of the slashes characters. |
[Level: Medium] An adversary can use more sophisticated tool or script to scan a website and find a path filtering problem. |
Indicators
| If the first path decoding process has left some invalid or denylisted characters, that may be a sign that the request is malicious. |
| Traffic filtering with IDS (or proxy) can detect request with suspicious URLs. IDS may use signature based identification to reveal such URL based attacks. |
| An adversary can use a fuzzer in order to probe for a UTF-8 encoding vulnerability. The fuzzer should generate suspicious network activity. |
Consequences This table specifies different individual consequences associated with the attack pattern. The Scope identifies the security property that is violated, while the Impact describes the negative technical impact that arises if an adversary succeeds in their attack. The Likelihood provides information about how likely the specific consequence is expected to be seen relative to the other consequences in the list. For example, there may be high likelihood that a pattern will be used to achieve a certain impact, but a low likelihood that it will be exploited to achieve a different impact.| Scope | Impact | Likelihood |
|---|
Confidentiality | Read Data | | Confidentiality Integrity Availability | Execute Unauthorized Commands | | Confidentiality Access Control Authorization | Gain Privileges | |
Mitigations
| Any security checks should occur after the data has been decoded and validated as correct data format. Do not repeat decoding process, if bad character are left after decoding process, treat the data as suspicious, and fail the validation process. Refer to the RFCs to safely decode URL. |
| When client input is required from web-based forms, avoid using the "GET" method to submit data, as the method causes the form data to be appended to the URL and is easily manipulated. Instead, use the "POST method whenever possible. |
| There are tools to scan HTTP requests to the server for valid URL such as URLScan from Microsoft (http://www.microsoft.com/technet/security/tools/urlscan.mspx) |
| Be aware of the threat of alternative method of data encoding and obfuscation technique such as IP address encoding. (See related guideline section) |
| Test your path decoding process against malicious input. |
| In the case of path traversals, use the principle of least privilege when determining access rights to file systems. Do not allow users to access directories/files that they should not access. |
| Assume all input is malicious. Create an allowlist that defines all valid input to the application based on the requirements specifications. Input that does not match against the allowlist should not be permitted to enter into the system. |
Example Instances
| Attack Example: Slashes in Alternate Encodings The two following requests are equivalent on most Web servers: http://target server/some_directory\..\..\..\winnt is equivalent to http://target server/some_directory/../../../winnt Multiple encoding conversion problems can also be leveraged as various slashes are instantiated in URL-encoded, UTF-8, or Unicode. Consider the strings http://target server/some_directory\..%5C..%5C..\winnt where %5C is equivalent to the \ character. |
Taxonomy Mappings CAPEC mappings to ATT&CK techniques leverage an inheritance model to streamline and minimize direct CAPEC/ATT&CK mappings. Inheritance of a mapping is indicated by text stating that the parent CAPEC has relevant ATT&CK mappings. Note that the ATT&CK Enterprise Framework does not use an inheritance model as part of the mapping to CAPEC.Relevant to the ATT&CK taxonomy mapping (see
parent
) References
[REF-1] G. Hoglund and
G. McGraw. "Exploiting Software: How to Break Code". Addison-Wesley. 2004-02.
|
|
|
Content History | Submissions |
|---|
| Submission Date | Submitter | Organization |
|---|
| 2014-06-23 (Version 2.6) | CAPEC Content Team | The MITRE Corporation | | | Modifications |
|---|
| Modification Date | Modifier | Organization |
|---|
| 2017-01-09 (Version 2.9) | CAPEC Content Team | The MITRE Corporation | | Updated Related_Attack_Patterns | | 2020-07-30 (Version 3.3) | CAPEC Content Team | The MITRE Corporation | | Updated Indicators, Mitigations | | 2021-06-24 (Version 3.5) | CAPEC Content Team | The MITRE Corporation | | Updated Related_Weaknesses | | 2022-02-22 (Version 3.7) | CAPEC Content Team | The MITRE Corporation | | Updated Description, Execution_Flow, Indicators, Skills_Required | | 2022-09-29 (Version 3.8) | CAPEC Content Team | The MITRE Corporation | | Updated Example_Instances |
More information is available — Please select a different filter.
|