Dark Mode

Settings

Capec-79 Detail

Using Slashes in Alternate Encoding

Detailed Software Likelihood: High Typical Severity: High

Parents: 267

Threats: T62 T290 T291

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.

Not present

External ID Source Link Description
CAPEC-79 capec https://capec.mitre.org/data/definitions/79.html
CWE-173 cwe http://cwe.mitre.org/data/definitions/173.html
CWE-180 cwe http://cwe.mitre.org/data/definitions/180.html
CWE-181 cwe http://cwe.mitre.org/data/definitions/181.html
CWE-20 cwe http://cwe.mitre.org/data/definitions/20.html
CWE-74 cwe http://cwe.mitre.org/data/definitions/74.html
CWE-73 cwe http://cwe.mitre.org/data/definitions/73.html
CWE-22 cwe http://cwe.mitre.org/data/definitions/22.html
CWE-185 cwe http://cwe.mitre.org/data/definitions/185.html
CWE-200 cwe http://cwe.mitre.org/data/definitions/200.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
REF-525 reference_from_CAPEC http://www.cl.cam.ac.uk/~mgk25/unicode.html Markus Kuhn, UTF-8 and Unicode FAQ for Unix/Linux, 1999--06---04
REF-495 reference_from_CAPEC http://www.cgisecurity.com/lib/URLEmbeddedAttacks.html Gunter Ollmann, URL Encoded Attacks - Attacks using the common web browser, CGISecurity.com
Explore
  1. 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. 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
  1. 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.

  2. Techniques
    Try both backslash and forward slash characters
    Try different encodings for slash characters such as %5C
Exploit
  1. 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.

  1. The application server accepts paths to locate resources.
  2. The application server does insufficient input data validation on the resource path requested by the user.
  3. The access right to resources are not set properly.

Not present

Low Medium
An adversary can try variation of the slashes characters.
An adversary can use more sophisticated tool or script to scan a website and find a path filtering problem.
Integrity Availability Authorization Access Control Confidentiality
Execute Unauthorized Commands (Run Arbitrary Code) Execute Unauthorized Commands (Run Arbitrary Code) Gain Privileges Gain Privileges Read Data
Execute Unauthorized Commands (Run Arbitrary Code)
Gain Privileges
  1. 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.