path-traversal
Skill2 starsChanged 2 months agoMITView on GitHub
Detect path traversal and Zip Slip vulnerabilities where user-controlled path components can escape intended directories.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- cdxiaodong/cain-agenttheir own version, first seen Oct 8, 2026
- awarexone/AXguardtheir own version, first seen Sep 15, 2026
- emre-guler/websectheir own version, first seen Aug 27, 2026
- thejefflarson/soundchecktheir own version, first seen Jul 31, 2026
- hackingyseguridad/IAtheir own version, first seen Jun 19, 2026
- langbyyi/websec-skillstheir own version, first seen Jun 12, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- cdxiaodong/cain-agent★ 953same name
- thejefflarson/soundcheck★ 20same name
- awarexone/AXguard★ 17same name
- langbyyi/websec-skills★ 4same name
- hackingyseguridad/IA★ 3same name
- emre-guler/websec★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository255 other files it gives its agents.
- ad-acl-abuseSkill
- ad-adcs-access-and-relaySkill
- ad-adcs-persistenceSkill
- ad-adcs-template-abuseSkill
- ad-ad-discoverySkill
- ad-ad-persistenceSkill
- ad-auth-coercion-relaySkill
- ad-credential-dumpingSkill
- ad-gpo-abuseSkill
- ad-kerberos-delegationSkill
- ad-kerberos-roastingSkill
- ad-kerberos-ticket-forgingSkill
- ad-pass-the-hashSkill
- ad-sccm-exploitationSkill
- ad-trust-attacksSkill
- hunt-ntlm-infoSkill
- offensive-active-directorySkill
- hunt-llm-aiSkill
- hunt-rag-vectorSkill
- offensive-ai-securitySkill
- cloud-iam-deepSkill
- hunt-cloud-misconfigSkill
- hunt-k8sSkill
- m365-entra-attackSkill
- network-container-escapesSkill
- offensive-cloudSkill
- offensive-container-escapeSkill
- offensive-k8s-attacksSkill
- okta-attackSkill
- vmware-vcenter-attackSkill
- credential-password-sprayingSkill
- hunt-brute-forceSkill
- hunt-forgot-passwordSkill
- post-exploit-credential-recoverySkill
- meme-coin-auditSkill
- offensive-crypto-attacksSkill
- web3-auditSkill
- ctfSkill
- advisory-miningSkill
- auth-bypassSkill
- code-injection-codegenSkill
- command-injectionSkill
- cross-pollinationSkill
- cve-hunting-methodologySkill
- decompression-bombSkill
- entity-expansionSkill
- fp-checkSkill
- method-clobberingSkill
- prototype-pollutionSkill
- recursion-dosSkill
- redosSkill
- sandbox-escapeSkill
- target-reconSkill
- web2-vuln-classesSkill
- evasion-av-edr-evasionSkill
- offensive-anti-forensicsSkill
- offensive-edr-evasionSkill
- offensive-keylogger-archSkill
- offensive-mitigationsSkill
- offensive-waf-bypassSkill
- The first 60 shown.
The file
Files
Path Traversal & Zip Slip Detection
When to Use
Audit archive extraction libraries, file upload handlers, static file servers, file path utilities, and any package that writes files based on user-controlled names.
~85% CVE acceptance rate when confirmed.
Key Insight
path.join() does NOT prevent .. traversal in Node.js:
path.join('/uploads', '../../../etc/passwd')
// Returns: '/etc/passwd' -- NOT '/uploads/etc/passwd'path.resolve() returns an absolute path but also does NOT validate that it stays within a base directory.
Variants
1. Classic Path Traversal
User controls a filename/path parameter that is concatenated with a base directory:
const filePath = path.join(uploadDir, req.params.filename);
fs.readFileSync(filePath); // ../../../etc/passwd2. Zip Slip
Malicious archive entries contain ../ in their filenames. During extraction, files are written outside the intended directory:
malicious.zip contains:
../../../../tmp/pwned.txt3. Symlink Following
Archive contains a symlink pointing outside the target directory, then a file targeting that symlink. During extraction, the file follows the symlink and writes to an arbitrary location.
4. Backslash Bypass
On Windows or with naive path checks, ..\ bypasses ../ filtering:
filename = "..\\..\\..\\etc\\passwd"5. URL Encoding Bypass
%2e%2e%2f = ../
%2e%2e/ = ../
..%2f = ../
Double encoding: %252e%252e%252f6. Null Byte (Legacy)
../../etc/passwd%00.pngOlder systems truncate at null byte. Rare in modern runtimes.
Process
Step 1: Find File Operations
# JavaScript/TypeScript
grep -rn "fs\.writeFile\|fs\.createWriteStream\|fs\.rename\|fs\.copyFile" .
grep -rn "fs\.readFile\|fs\.readFileSync\|fs\.createReadStream" .
grep -rn "path\.join\|path\.resolve" .
# Python
grep -rn "open(.*w\|shutil\.copy\|shutil\.move\|os\.rename" .
grep -rn "extractall\|extract(" .
# Go
grep -rn "os\.Create\|os\.OpenFile\|io\.Copy\|filepath\.Join" .
grep -rn "archive/zip\|archive/tar" .Step 2: Check Archive Extraction
grep -rn "unzip\|extract\|decompress\|gunzip\|untar" .
grep -rn "adm-zip\|yauzl\|unzipper\|archiver\|tar\|fflate\|JSZip\|node-7z" .
grep -rn "zipfile\|tarfile\|py7zr\|patool" .Step 3: Check Path Validation
grep -rn "startsWith\|indexOf\|includes\|realpath\|normalize" .
grep -rn "\.\." . --include="*.js" | grep -i "reject\|deny\|block\|filter"Step 4: Verify Validation Effectiveness
Common INCORRECT validations:
path.join(base, input)-- does NOT prevent traversalinput.indexOf('..') === -1-- can be bypassed with....//or encodinginput.replace('../', '')-- bypassed with....//(after removal,../remains)
CORRECT validations:
path.resolve(base, input)thenresult.startsWith(base + path.sep)-- verifies result is within basefs.realpathSync()to resolve symlinks before checking
CVSS Guidance
- Arbitrary file read (unauthenticated): HIGH 7.5
- Arbitrary file write via Zip Slip: HIGH 7.5-8.1
- File write + code execution (overwrite config/executable): CRITICAL 9.8
- Authenticated file read: MEDIUM 6.5
References
- Sinks -- File operation sinks by language
- False Positive Indicators -- When this isn't exploitable
- PoC Skeleton -- Path traversal and Zip Slip PoC templates
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

