path-traversal

path-traversal is a skill for Claude Code from ByamB4/find-cve-agent. It costs 22 tokens per session (1,091 once invoked), scanned A, original, Apache-2.0.

A security review for path traversal, where crafted file names escape an intended directory. It also covers Zip Slip, the same problem through archive entries.

In plain words
What is it for?
Use it to inspect file uploads, downloads, static file servers, archive extraction, and path-handling utilities.
Why use it?
It helps find file operations that can read or write outside their allowed location.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is path.join('/uploads', '../../../etc/passwd').

Part of the find-cve-agent plugin — 21 skills, 7 commands, 5 agents shipped together

Good fit Use it to inspect file uploads, downloads, static file servers, archive extraction, and path-handling utilities.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/ByamB4/find-cve-agent
agentmods
npx agentmods add skills/byamb4/find-cve-agent/path-traversal

Made for: Claude Code.

Or install find-cve-agent, the plugin that ships this one along with the rest of its 21 skills, 7 commands, 5 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for path-traversal

README.md
[![agentmods](https://agentmods.dev/badge/skills/byamb4/find-cve-agent/path-traversal/github.svg)](https://agentmods.dev/skills/byamb4/find-cve-agent/path-traversal)
Your own site
<a href="https://agentmods.dev/skills/byamb4/find-cve-agent/path-traversal"><img src="https://agentmods.dev/badge/skills/byamb4/find-cve-agent/path-traversal/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for path-traversal

Your own site · 80×15
<a href="https://agentmods.dev/skills/byamb4/find-cve-agent/path-traversal"><img src="https://agentmods.dev/badge/skills/byamb4/find-cve-agent/path-traversal.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,091 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.01091
Opus 5 $0.00011 $0.00545
Sonnet 5 $0.00004 $0.00218
Haiku 4.5 $0.00002 $0.00109

Measured 9d ago against content hash 7ec7b93509b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

path-traversal scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/path-traversal/SKILL.md · 130 lines

How it starts

The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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" .

Read the full file on GitHub · 130 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 130 lines · 22 tokens per session scan A 7ec7b93509b7

Subscribe to this mod's changes

path-traversal is a skill published in the GitHub repository ByamB4/find-cve-agent (48 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 22 tokens to every session and 1,091 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories