scanrub
Path Traversal

Path Traversal

2 min read 214 reports analyzed ScanRub Research
Share
Live Playground · Powered by this research
Path Traversal Checker

Enter a file path with traversal sequences to see what it resolves to.

Traversal sequences (../)2
Encoded traversalNo
Decoded path../../etc/passwd
Normalized path/etc/passwd
Path escapes intended directory. Server must reject this input.
Payloads from this research (7 total)
../../../../etc/passwd
..%2F..%2F..%2Fetc%2Fpasswd
..%252F..%252F..%252Fetc%252Fpasswd
%%32%65%%32%65/etc/passwd
These payloads were synthesized from real HackerOne disclosures. Click any payload to copy it, then paste it into the tester above to see how our detection classifies it.

Summary

Path traversal lets an attacker read, and sometimes write, files outside a web app's intended directory via ../ sequences in a file-path parameter. Canonical Path Traversal category. Reports cluster around:

  • classic ../ traversal in URL parameters used as file paths
  • Apache HTTPD CVE-2021-42013 path-traversal RCE bypass with %%32%65 style payloads
  • Cisco ASA CVE-2018-0296
  • mobile-app filename-based traversal via attachment rename
  • static-asset path traversal that exposes source code (.git, build.sbt). Detection mostly handled by existing lfi module + Nuclei CVE templates.
◈ flow diagram
User RequestFile Path Pa…Directory Tr…File System …Sensitive Fi…
◈ chart
Critical
32
High
96
Medium
64
Low
21

Top Affected Components / Targets

  • URL params named file, path, name, doc, page, view
  • Static-asset routes with prefix matching
  • File-download endpoints
  • Apache HTTPD 2.4.49 / 2.4.50 (CVE-2021-41773 / CVE-2021-42013)
  • Cisco ASA web interface

Common Attack Vectors

  • Inject ../, ..%2F, ..%252F, %%32%65, encoded-CR variants
  • Probe known traversal CVE paths against fingerprinted Apache / Cisco
  • Submit .. in upload filename

Common Payloads

  • ../../../../etc/passwd
  • ..%2F..%2F..%2Fetc%2Fpasswd
  • ..%252F..%252F..%252Fetc%252Fpasswd
  • %%32%65%%32%65/etc/passwd
  • /cgi-bin/%%32%65%%32%65/etc/passwd
  • \..\..\..\windows\win.ini
  • ....//....//etc/passwd

Detection Strategy

Standard traversal-payload testing, extended with encoding variants that specifically bypass naive filters, the double-URL-encoded slash (%%32%65) that defeated Apache's own path normalization in CVE-2021-41773, decimal-encoded slashes, and double URL encoding generally, covers the bulk of real-world cases. Version-fingerprint CVE matching catches the well-known, high-impact instances in specific software, including the Apache HTTPD path-traversal-to-RCE chain (CVE-2021-41773, CVE-2021-42013) and Cisco ASA's path traversal (CVE-2018-0296).

Tip: Testing tools that run these checks in parallel across every discovered endpoint can cut the time required substantially compared to fully manual testing, as long as they confirm findings with more than one signal to keep the false-positive rate down.

False-Positive Notes

Existing lfi module already does baseline comparison; reuse that guard for the extended payload set.

How to Test

Manual Testing Methodology

Here is a systematic approach to identifying Path Traversal vulnerabilities in a target application.

Step 1: Reconnaissance and Surface Mapping

Before testing, map all input vectors that could be affected. Identify parameters, headers, cookies, and request bodies that interact with the vulnerable component. A proxy such as Burp Suite or OWASP ZAP, paired with normal browsing of the target, is usually enough to build this list.

Step 2: Baseline Request

Send a legitimate request and record the normal response: status code, content length, response time, and any identifying tokens. This baseline matters because it's what you'll compare later responses against once payloads are involved.

Step 3: Payload Injection

Inject test payloads into each identified input vector one at a time. Start with benign detection payloads before escalating to anything that could actually trigger the vulnerability. For Path Traversal specifically, submit ../ sequences of increasing depth (../etc/passwd, ../../etc/passwd, and so on) alongside URL-encoded (%2e%2e%2f), double-encoded, and null-byte variants against every file-path parameter, and try both forward- and back-slash separators since one is sometimes filtered while the other isn't.

Step 4: Response Analysis

Compare the response against your baseline, looking specifically for the actual contents of a known system file (/etc/passwd, win.ini) appearing in the response, or a distinct error message (a different exception type or path echoed back) between a valid relative path and a traversal attempt.

Step 5: Confirmation

Once a potential vulnerability is detected, confirm it with at least a few independent test cases to rule out coincidence. Document the exact request and response as proof. For Path Traversal, a confirmed finding typically means showing that attacker-controlled input changes the application's behavior in a way that matters for security, not just that a payload was reflected somewhere harmless.

Real-World Impact

Real-World Impact

Path traversal lets attackers read, and sometimes write, files outside the directory an application intended to expose, usually by slipping ../ sequences into a file path parameter. Successful exploitation can expose source code, configuration files containing database credentials and API keys, and system files like /etc/passwd. In write scenarios, it can lead directly to code execution through a planted web shell.

In containerized environments, path traversal can escape an application's own file namespace to read secrets, environment variables, and mounted volumes belonging to other services entirely. In cloud deployments, it can expose provider-specific metadata files too.

This bug class becomes especially dangerous when combined with file inclusion. Reading a file is an information disclosure on its own, but if that file gets executed, the finding becomes remote code execution.

Prevention & Remediation

Prevention and Secure Coding

Preventing Path Traversal takes a defense-in-depth approach — no single control below is sufficient alone, but together they close off both the primary path and the most common bypasses.

Canonicalize and verify containment. Resolve the requested path to its canonical absolute form and check that it still falls inside an allowlisted base directory before touching the filesystem — check this after resolving symlinks and encoded sequences, not before.

Map to an internal ID, not a raw path. Where feasible, have user input select from a server-side allowlist or database record (an internal file ID) rather than being used as any part of a filesystem path directly.

Reject traversal sequences outright. Reject requests containing ../, .., URL-encoded variants (%2e%2e%2f), and null bytes rather than trying to strip them — stripping is a common source of filter-bypass bugs when done with a single non-recursive replace.

Least-privilege filesystem access. Run the file-serving process under an account with read access to only the directories it legitimately needs, so a traversal that gets past the application-layer check still hits an OS-level permission wall.

Disable directory listing and dangerous parsers. Serve static content through a web server configuration that has autoindexing disabled and doesn't execute uploaded files as scripts.

Frequently Asked Questions

What is Path Traversal?
Path traversal lets an attacker read, and sometimes write, files outside a web app's intended directory via `../` sequences in a file-path parameter.
How common is Path Traversal in bug bounty reports?
Scanrub's research corpus for this playbook is built from 214 disclosed HackerOne reports in this category, synthesized for detection and prevention guidance rather than reproduced verbatim.
How do I test for Path Traversal?
Map every input vector, record a baseline response, then inject targeted test payloads one field at a time and compare the response for timing, length, error, or reflection differences from that baseline. The "How to Test" section above walks through the full methodology for this specific vulnerability class.
What is the single most effective fix for Path Traversal?
Resolve every file-path input to its canonical absolute form and verify it stays inside an allowlisted base directory before any filesystem operation.
Weekly security research

New vulnerability playbooks, tool updates, and bug bounty insights - delivered to your inbox. No spam.

Unsubscribe anytime. We respect your inbox.
Press ⌘K to search×