Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
npm-tar-path-traversal-scanner — Scanner: CVE-2026-31802 npm tar path traversal — Python checker for arbitrary file write via npm pack | Kitploit
Tools/GitHubGitHub/ridhinva/npm-tar-path-traversal-scanner
Static AnalysisVulnerability ScannersCode AnalysisSupply Chain SecurityLearning & Education
GitHubridhinva/npm-tar-path-traversal-scanner

npm-tar-path-traversal-scanner

Scanner: CVE-2026-31802 npm tar path traversal — Python checker for arbitrary file write via npm pack

View Repository

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
13 days agoNot yet reviewed

CVE-2026-31802 — npm tar Path Traversal Scanner

Detects npm packages vulnerable to CVE-2026-31802, a path traversal vulnerability in the tar npm package that allows arbitrary file writes during archive extraction.

Features

  • Scans package-lock.json for vulnerable tar versions
  • Checks node_modules for installed vulnerable packages
  • Tests extraction behavior with crafted tar archives
  • Identifies dependency chains leading to vulnerable tar
  • Supports bulk scanning of multiple projects
  • JSON/CSV report generation
  • Remediation recommendations

Installation

root@kitploit:~
git clone https://github.com/ridhinva/npm-tar-traversal-scanner.git
cd npm-tar-traversal-scanner
pip3 install -r requirements.txt

Usage

Scan Current Directory

root@kitploit:~
python3 npm_tar_scanner.py

Scan Specific Project

root@kitploit:~
python3 npm_tar_scanner.py /path/to/project

Scan package-lock.json Directly

root@kitploit:~
python3 npm_tar_scanner.py --lock-file /path/to/package-lock.json

Bulk Scan Multiple Projects

root@kitploit:~
python3 npm_tar_scanner.py --bulk /path/to/projects/

Generate Report

root@kitploit:~
python3 npm_tar_scanner.py --report json --output report.json
python3 npm_tar_scanner.py --report csv --output report.csv

Check with Exploit Test

root@kitploit:~
python3 npm_tar_scanner.py --test-exploit /path/to/project

Vulnerable Versions

PackageVulnerable RangeFixed In
tar< 6.2.16.2.1
tar7.0.0-alpha.0 - 7.0.0-alpha.57.0.0-alpha.6

How It Works

  1. Parses package-lock.json to extract dependency tree
  2. Checks tar package version against known vulnerable ranges
  3. Identifies if tar is a direct or transitive dependency
  4. Optionally tests extraction with a crafted tar containing ../ path entries
  5. Reports vulnerable projects with dependency chain and remediation steps

Example Output

root@kitploit:~
[!] CVE-2026-31802 - npm tar Path Traversal Scanner
[+] Scanning: /home/user/my-project
[!] VULNERABLE: [email protected] (locked in package-lock.json)
    Path: node_modules/tar
    Dependency chain: my-project -> node-gyp -> tar
    Severity: HIGH - Arbitrary file write during extraction
    Fix: Update to [email protected] or later

References

  • CVE-2026-31802
  • npm tar package: https://www.npmjs.com/package/tar
  • CISA KEV: 2026-05-22

Author

@c_y_p_h3r

Legal Disclaimer

For authorized security testing and educational purposes only.

Download Tool