repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
index.mdMarkdown82 lines6.0 KiBsource raw download

title: "Client Side Path Traversal" topic: "Client Side Path Traversal" topicSlug: "client-side-path-traversal" sourcePath: "Client Side Path Traversal/README.md" sourceUrl: "https://github.com/swisskyrepo/PayloadsAllTheThings/blob/3ac27901c711/Client%20Side%20Path%20Traversal/README.md" sha: "3ac27901c711" isReadme: true#

Client Side Path Traversal#

Client-Side Path Traversal (CSPT), sometimes also referred to as "On-site Request Forgery," is a vulnerability that can be exploited as a tool for CSRF or XSS attacks.
It takes advantage of the client side's ability to make requests using fetch to a URL, where multiple "../" characters can be injected. After normalization, these characters redirect the request to a different URL, potentially leading to security breaches.
Since every request is initiated from within the frontend of the application, the browser automatically includes cookies and other authentication mechanisms, making them available for exploitation in these attacks.

Summary#

Tools#

Methodology#

CSPT to XSS#

cspt-query-param

A post-serving page calls the fetch function, sending a request to a URL with attacker-controlled input which is not properly encoded in its path, allowing the attacker to inject ../ sequences to the path and make the request get sent to an arbitrary endpoint. This behavior is referred to as a CSPT vulnerability.

Example:

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 ? :white_check_mark: :white_check_mark:
Can control the body ? :white_check_mark: :x:
Can work with anti-CSRF token ? :x: :white_check_mark:
Can work with Samesite=Lax ? :x: :white_check_mark:
GET / PATCH / PUT / DELETE CSRF ? :x: :white_check_mark:
1-click CSRF ? :x: :white_check_mark:
Does impact depend on source and on sinks ? :x: :white_check_mark:

Real-World Scenarios:

Labs#

References#