ajtazer/heckit / skills/cve-hunting/path-traversal
path-traversal
VerifiedDetect path traversal and Zip Slip vulnerabilities where user-controlled path components can escape intended directories.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.7 KB |
| references/false-positive-indicators.md | markdown | 1.4 KB |
| references/poc-skeleton.md | markdown | 2.8 KB |
| references/sinks.md | markdown | 2.3 KB |
references/sinks.md
View on GitHub# File Operation Sinks by Language
## JavaScript / TypeScript
| Sink | Operation | Risk |
|------|-----------|------|
| `fs.writeFile(path, data)` | Write | HIGH -- arbitrary file write |
| `fs.writeFileSync(path, data)` | Write | HIGH |
| `fs.createWriteStream(path)` | Write | HIGH |
| `fs.readFile(path)` | Read | MEDIUM -- arbitrary file read |
| `fs.readFileSync(path)` | Read | MEDIUM |
| `fs.createReadStream(path)` | Read | MEDIUM |
| `fs.rename(old, new)` | Move | HIGH -- can move files outside dir |
| `fs.copyFile(src, dst)` | Copy | HIGH |
| `fs.unlink(path)` | Delete | HIGH -- arbitrary file delete |
| `path.join(base, input)` | Construct | UNSAFE -- does NOT prevent ../ |
| `path.resolve(input)` | Construct | UNSAFE -- still needs startsWith check |
### Archive Libraries
| Library | Function | Zip Slip Status |
|---------|----------|-----------------|
| adm-zip | `extractAllTo()` | VULNERABLE in older versions |
| yauzl | `entry.fileName` | SAFE -- warns in docs, user must validate |
| unzipper | `Extract()` | CHECK -- some versions vulnerable |
| tar | `tar.extract()` | CHECK -- preservePaths option |
| decompress | `decompress()` | VULNERABLE in older versions |
| fflate | `unzipSync()` | CHECK version |
| JSZip | `forEach()` + manual extract | User responsibility |
## Python
| Sink | Operation | Risk |
|------|-----------|------|
| `open(path, 'w')` | Write | HIGH |
| `shutil.copy(src, dst)` | Copy | HIGH |
| `shutil.move(src, dst)` | Move | HIGH |
| `os.rename(old, new)` | Move | HIGH |
| `zipfile.extractall()` | Extract | CHECK -- Python 3.12+ has filter param |
| `tarfile.extractall()` | Extract | VULNERABLE -- CVE-2007-4559 (partially fixed) |
| `os.path.join(base, input)` | Construct | UNSAFE if input starts with / |
## Go
| Sink | Operation | Risk |
|------|-----------|------|
| `os.Create(path)` | Write | HIGH |
| `os.OpenFile(path, ...)` | Read/Write | HIGH |
| `io.Copy(dst, src)` | Copy | Depends on dst |
| `filepath.Join(base, input)` | Construct | UNSAFE -- Clean() does NOT prevent ../ above base |
| `filepath.Clean(path)` | Normalize | Does NOT validate, only normalizes |
### Go safe pattern
```go
// CORRECT: Check result stays within base
absPath := filepath.Join(base, userInput)
if !strings.HasPrefix(absPath, filepath.Clean(base) + string(os.PathSeparator)) {
return errors.New("path traversal detected")
}
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |