---
title: "Client Side Path Traversal"
section: "Web Pentesting"
sectionSlug: "pentesting-web"
sourcePath: "src/pentesting-web/client-side-path-traversal.md"
sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/pentesting-web/client-side-path-traversal.md"
sha: "188de82beb54e70956b2952367a0af91d26758b8"
isIndex: false
modified: true
license: "CC-BY-NC-4.0"
---
# Client Side Path Traversal
## Basic Information
A client-side path traversal (CSPT), also called **on-site request forgery (OSRF)**, occurs when attacker-controlled data is inserted into a URL path used by client-side code. By injecting dot segments such as `../`, an attacker can make the victim's browser send an authenticated request to a different path on the same origin. The request may carry cookies, JavaScript-added authorization headers, or a client certificate, depending on how the application constructs it.[[5]](#references)[[7]](#references)
Typical sources (data you control) include route parameters, stored values, and UI-controlled path fragments:[[7]](#references)[[8]](#references)
- Route parameters that get concatenated into `fetch()` or XHR paths (React Router, Next.js dynamic routes, Vue router params, Angular `ActivatedRoute`).
- Stored values (profile slugs, document IDs) that are interpolated into paths inside background jobs, service workers, or WebSocket URLs.
- UI gadgets (download/export buttons, image galleries) that append user-controlled fragments or file extensions to API endpoints before the request is dispatched.
Typical sinks (where the traversal lands) include request builders and navigation or resource-loading APIs:[[7]](#references)[[8]](#references)
- Frontend API wrappers that prepend `/api/` or `/proxy/` and reuse auth headers automatically.
- `history.pushState` / `router.navigate` helpers that reconstruct URLs later during hydration.
- ``/`