/cve-scan - Dependency CVE Scanner
$ARGUMENTS
Detect project ecosystems and scan dependencies for known vulnerabilities using native audit tools. Zero external dependencies — uses tools already installed in the project environment.
Usage
/cve-scan # Auto-detect all ecosystems, scan all
/cve-scan --ecosystem npm # Force specific ecosystem
/cve-scan --fix # Auto-fix where possible (npm audit fix, etc.)
/cve-scan --json # Machine-readable JSON output
What This Command Does
- Detect package managers by lock/manifest files in the project
- Run the native audit command for each detected ecosystem
- Parse results into a unified severity-based report
- Report CVE IDs, affected packages, installed vs fixed versions, advisory links
- Fix automatically when
--fix is passed (where the tool supports it)
Ecosystem Detection & Commands
| Manifest File |
Lock File |
Ecosystem |
Audit Command |
CVE Database |
package.json |
package-lock.json / yarn.lock / pnpm-lock.yaml |
npm/yarn/pnpm |
npm audit --json / yarn audit --json / pnpm audit --json |
GitHub Advisory DB |
requirements.txt / pyproject.toml / setup.py |
requirements.txt |
pip |
pip-audit --format=json |
OSV / PyPI Advisory |
composer.json |
composer.lock |
composer |
composer audit --format=json |
Packagist / FriendsOfPHP |
Cargo.toml |
Cargo.lock |
cargo |
cargo audit --json |
RustSec Advisory DB |
go.mod |
go.sum |
go |
govulncheck ./... |
Go Vulnerability DB |
Gemfile |
Gemfile.lock |
bundler |
bundle-audit check |
Ruby Advisory DB |
pubspec.yaml |
pubspec.lock |
dart/flutter |
dart pub outdated --json |
pub.dev |
Steps
- Detect ecosystems: Glob for manifest/lock files at project root and common subdirectories
- Check tool availability: Verify audit tool is installed for each detected ecosystem
- Run audit: Execute native audit command, capture JSON output where available
- Parse results: Extract CVE ID, package name, installed version, fixed version, severity, advisory URL
- Unified report: Merge all ecosystems into single report sorted by severity
- Fix mode: If
--fix passed, run npm audit fix, pip-audit --fix, cargo audit fix etc.
- Exit code: Non-zero if any CRITICAL or HIGH vulnerabilities found
Detection Script
Run the bundled detection script to quickly identify ecosystems and tool availability:
python3 ${CLAUDE_SKILL_DIR}/scripts/cve_scan.py
Options:
python3 ${CLAUDE_SKILL_DIR}/scripts/cve_scan.py --json # JSON output
python3 ${CLAUDE_SKILL_DIR}/scripts/cve_scan.py --fix # Auto-fix mode
python3 ${CLAUDE_SKILL_DIR}/scripts/cve_scan.py --ecosystem npm # Specific ecosystem
Output Format
## CVE Scan Report
### Ecosystems Detected
- npm (package-lock.json) — `npm audit` available ✓
- pip (requirements.txt) — `pip-audit` not installed ⚠️
### Summary
| Severity | Count |
|----------|-------|
| CRITICAL | 1 |
| HIGH | 3 |
| MEDIUM | 5 |
| LOW | 2 |
### Findings
#### [CRITICAL] lodash@4.17.20 (npm)
- **CVE**: CVE-2021-23337
- **Title**: Prototype Pollution
- **Fixed in**: 4.17.21
- **Advisory**: https://github.com/advisories/GHSA-35jh-r3h4-6jhm
#### [HIGH] django@3.2.0 (pip)
- **CVE**: CVE-2023-36053
- **Title**: Potential ReDoS in EmailValidator
- **Fixed in**: 3.2.20
- **Advisory**: https://osv.dev/vulnerability/PYSEC-2023-100
### Tool Availability
| Ecosystem | Tool | Status | Install Hint |
|-----------|------|--------|--------------|
| npm | npm audit | ✓ installed | — |
| pip | pip-audit | ✗ missing | `pip install pip-audit` |
| cargo | cargo-audit | ✗ missing | `cargo install cargo-audit` |
Handling Missing Tools
When an audit tool is not installed, the skill:
- Reports it as a warning (not a failure)
- Provides the install command for the missing tool
- Continues scanning other detected ecosystems
Install hints per ecosystem:
| Tool |
Install Command |
pip-audit |
pip install pip-audit |
cargo-audit |
cargo install cargo-audit |
govulncheck |
go install golang.org/x/vuln/cmd/govulncheck@latest |
bundle-audit |
gem install bundler-audit |
composer |
Built-in since Composer 2.4 |
Rules
- Never modify
package-lock.json, Cargo.lock, or other lock files without --fix flag
- Always report tool availability — missing tool is a finding, not a failure
- Parse JSON output when available for structured data; fall back to text parsing
- CRITICAL and HIGH findings should be highlighted prominently
- Include advisory URLs for every CVE when available
- This skill is READ-ONLY by default (no installs, no upgrades) unless
--fix is passed
- Respect
.auditrc, .nsprc, or equivalent ignore files if present
1---2name: cve-scan3description: "Scans deps for known CVEs via native audit (npm, pip, composer, cargo, go, bundler, dart). Triggers: CVE scan, vulnerability scan, npm audit, pip audit."4user-invocable: true5effort: medium6argument-hint: "[--ecosystem npm|pip|composer|cargo|go|ruby|dart] [--fix] [--json]"7allowed-tools: Read, Grep, Glob, Bash8---910# /cve-scan - Dependency CVE Scanner1112$ARGUMENTS1314Detect project ecosystems and scan dependencies for known vulnerabilities using native audit tools. Zero external dependencies — uses tools already installed in the project environment.1516## Usage1718```19/cve-scan # Auto-detect all ecosystems, scan all20/cve-scan --ecosystem npm # Force specific ecosystem21/cve-scan --fix # Auto-fix where possible (npm audit fix, etc.)22/cve-scan --json # Machine-readable JSON output23```2425## What This Command Does26271. **Detect** package managers by lock/manifest files in the project282. **Run** the native audit command for each detected ecosystem293. **Parse** results into a unified severity-based report304. **Report** CVE IDs, affected packages, installed vs fixed versions, advisory links315. **Fix** automatically when `--fix` is passed (where the tool supports it)3233## Ecosystem Detection & Commands3435| Manifest File | Lock File | Ecosystem | Audit Command | CVE Database |36|---------------|-----------|-----------|---------------|--------------|37| `package.json` | `package-lock.json` / `yarn.lock` / `pnpm-lock.yaml` | npm/yarn/pnpm | `npm audit --json` / `yarn audit --json` / `pnpm audit --json` | GitHub Advisory DB |38| `requirements.txt` / `pyproject.toml` / `setup.py` | `requirements.txt` | pip | `pip-audit --format=json` | OSV / PyPI Advisory |39| `composer.json` | `composer.lock` | composer | `composer audit --format=json` | Packagist / FriendsOfPHP |40| `Cargo.toml` | `Cargo.lock` | cargo | `cargo audit --json` | RustSec Advisory DB |41| `go.mod` | `go.sum` | go | `govulncheck ./...` | Go Vulnerability DB |42| `Gemfile` | `Gemfile.lock` | bundler | `bundle-audit check` | Ruby Advisory DB |43| `pubspec.yaml` | `pubspec.lock` | dart/flutter | `dart pub outdated --json` | pub.dev |4445## Steps46471. **Detect ecosystems**: Glob for manifest/lock files at project root and common subdirectories482. **Check tool availability**: Verify audit tool is installed for each detected ecosystem493. **Run audit**: Execute native audit command, capture JSON output where available504. **Parse results**: Extract CVE ID, package name, installed version, fixed version, severity, advisory URL515. **Unified report**: Merge all ecosystems into single report sorted by severity526. **Fix mode**: If `--fix` passed, run `npm audit fix`, `pip-audit --fix`, `cargo audit fix` etc.537. **Exit code**: Non-zero if any CRITICAL or HIGH vulnerabilities found5455## Detection Script5657Run the bundled detection script to quickly identify ecosystems and tool availability:5859```bash60python3 ${CLAUDE_SKILL_DIR}/scripts/cve_scan.py61```6263Options:64```bash65python3 ${CLAUDE_SKILL_DIR}/scripts/cve_scan.py --json # JSON output66python3 ${CLAUDE_SKILL_DIR}/scripts/cve_scan.py --fix # Auto-fix mode67python3 ${CLAUDE_SKILL_DIR}/scripts/cve_scan.py --ecosystem npm # Specific ecosystem68```6970## Output Format7172```markdown73## CVE Scan Report7475### Ecosystems Detected76- npm (package-lock.json) — `npm audit` available ✓77- pip (requirements.txt) — `pip-audit` not installed ⚠️7879### Summary80| Severity | Count |81|----------|-------|82| CRITICAL | 1 |83| HIGH | 3 |84| MEDIUM | 5 |85| LOW | 2 |8687### Findings8889#### [CRITICAL] lodash@4.17.20 (npm)90- **CVE**: CVE-2021-2333791- **Title**: Prototype Pollution92- **Fixed in**: 4.17.2193- **Advisory**: https://github.com/advisories/GHSA-35jh-r3h4-6jhm9495#### [HIGH] django@3.2.0 (pip)96- **CVE**: CVE-2023-3605397- **Title**: Potential ReDoS in EmailValidator98- **Fixed in**: 3.2.2099- **Advisory**: https://osv.dev/vulnerability/PYSEC-2023-100100101### Tool Availability102| Ecosystem | Tool | Status | Install Hint |103|-----------|------|--------|--------------|104| npm | npm audit | ✓ installed | — |105| pip | pip-audit | ✗ missing | `pip install pip-audit` |106| cargo | cargo-audit | ✗ missing | `cargo install cargo-audit` |107```108109## Handling Missing Tools110111When an audit tool is not installed, the skill:1121. Reports it as a warning (not a failure)1132. Provides the install command for the missing tool1143. Continues scanning other detected ecosystems115116Install hints per ecosystem:117118| Tool | Install Command |119|------|----------------|120| `pip-audit` | `pip install pip-audit` |121| `cargo-audit` | `cargo install cargo-audit` |122| `govulncheck` | `go install golang.org/x/vuln/cmd/govulncheck@latest` |123| `bundle-audit` | `gem install bundler-audit` |124| `composer` | Built-in since Composer 2.4 |125126## Rules127128- Never modify `package-lock.json`, `Cargo.lock`, or other lock files without `--fix` flag129- Always report tool availability — missing tool is a finding, not a failure130- Parse JSON output when available for structured data; fall back to text parsing131- CRITICAL and HIGH findings should be highlighted prominently132- Include advisory URLs for every CVE when available133- This skill is READ-ONLY by default (no installs, no upgrades) unless `--fix` is passed134- Respect `.auditrc`, `.nsprc`, or equivalent ignore files if present