AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Path Traversal

skill-byamb4-find-cve-agent-path-traversal · by ByamB4

Detect path traversal and Zip Slip vulnerabilities where user-controlled path components can escape intended directories.

No reviews yet
0 installs
33 views
0.0% view→install

Install

$ agentstack add skill-byamb4-find-cve-agent-path-traversal

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access Used
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-byamb4-find-cve-agent-path-traversal)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Path Traversal? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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/passwd

2. Zip Slip

Malicious archive entries contain ../ in their filenames. During extraction, files are written outside the intended directory:

malicious.zip contains:
  ../../../../tmp/pwned.txt

3. 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%252f

6. Null Byte (Legacy)

../../etc/passwd%00.png

Older 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 traversal
  • input.indexOf('..') === -1 -- can be bypassed with ....// or encoding
  • input.replace('../', '') -- bypassed with ....// (after removal, ../ remains)

CORRECT validations:

  • path.resolve(base, input) then result.startsWith(base + path.sep) -- verifies result is within base
  • fs.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](references/sinks.md) -- File operation sinks by language
  • [False Positive Indicators](references/false-positive-indicators.md) -- When this isn't exploitable
  • [PoC Skeleton](references/poc-skeleton.md) -- Path traversal and Zip Slip PoC templates

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.