advisory-mining
Mine GitHub Security Advisories and CVE databases for incomplete fixes, finding variant vulnerabilities in patched code or…
Detect path traversal and Zip Slip vulnerabilities where user-controlled path components can escape intended directories.
Claude Code
$ npx -y skills add ByamB4/find-cve-agent --skill path-traversal --agent claude-code
Codex
$ npx skills add ByamB4/find-cve-agent --skill path-traversal -a codex -y
Cursor
$ npx skills add ByamB4/find-cve-agent --skill path-traversal -a cursor -y
Gemini CLI
$ npx skills add ByamB4/find-cve-agent --skill path-traversal -a gemini-cli -y
GitHub Copilot
$ npx skills add ByamB4/find-cve-agent --skill path-traversal -a github-copilot -y
OpenCode
$ npx skills add ByamB4/find-cve-agent --skill path-traversal -a opencode -y
Windsurf
$ npx skills add ByamB4/find-cve-agent --skill path-traversal -a windsurf -y
name: path-traversal
description: "Detect path traversal and Zip Slip vulnerabilities where user-controlled path components can escape intended directories."
metadata:
filePattern:
- "**/*.js"
- "**/*.ts"
- "**/*.py"
- "**/*.go"
bashPattern:
- "semgrep.*path"
- "grep.*(path\\.join|writeFile|extractall)"
priority: 90Audit 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.
`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.
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/passwd
Malicious archive entries contain `../` in their filenames. During extraction, files are written outside the intended directory:
malicious.zip contains: ../../../../tmp/pwned.txt
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.
On Windows or with naive path checks, `..\` bypasses `../` filtering:
filename = "..\\..\\..\\etc\\passwd"
%2e%2e%2f = ../ %2e%2e/ = ../ ..%2f = ../ Double encoding: %252e%252e%252f
../../etc/passwd%00.png
Older systems truncate at null byte. Rare in modern runtimes.
# 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" .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" .
grep -rn "startsWith\|indexOf\|includes\|realpath\|normalize" . grep -rn "\.\." . --include="*.js" | grep -i "reject\|deny\|block\|filter"
Common INCORRECT validations:
CORRECT validations:
Open Source CVE Hunting Harness for Claude Code A Claude Code plugin that systematically finds real CVEs in open source packages through coordinated multi-agent security research.
Mine GitHub Security Advisories and CVE databases for incomplete fixes, finding variant vulnerabilities in patched code or…
Detect authentication and authorization bypass vulnerabilities including missing auth middleware, JWT algorithm confusion, IDOR,…
Detect code injection vulnerabilities in packages that dynamically generate or evaluate code via new Function(), eval(), vm.run*,…
Detect OS command injection via shell execution sinks where user-controlled input reaches system commands without proper…
Cross-pollination multiplier technique: find a vulnerability in one package, then search for the same pattern across all similar…
Detect decompression bomb vulnerabilities where compressed input can expand to exhaust memory, targeting buffer-based…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…