Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,36 @@
[![license](https://img.shields.io/npm/l/patchpilot)](https://github.com/ProduktEntdecker/patchpilot-cli/blob/main/LICENSE)
[![Node.js](https://img.shields.io/node/v/patchpilot)](https://nodejs.org)

Security scanner for vibe coders. Automatically checks npm, pip, and brew packages for vulnerabilities before Claude Code installs them.
Security scanner for vibe coders. Automatically checks npm, pip, and brew packages for vulnerabilities **and** supply chain risks before Claude Code installs them.

## How It Works

PatchPilot is a Claude Code **pre-execution hook** that intercepts install commands:
PatchPilot is a Claude Code **pre-execution hook** that intercepts install commands and runs two checks in parallel:

```
```text
You: "install lodash for me"
Claude: "npm install lodash@4.17.0"
PatchPilot: Checks OSV database
PatchPilot: ┌─ OSV database (known CVEs)
└─ Registry metadata (supply chain signals)
BLOCKED: 4 vulnerabilities found (1 critical, 3 high)
```

Uses the [OSV (Open Source Vulnerabilities)](https://osv.dev/) database - the same data source as `npm audit`.
### Supply Chain Protection

After the [Axios supply chain attack](https://www.a16z.news/p/et-tu-agent-did-you-install-the-backdoor) (March 2026), where a hijacked maintainer account injected a brand-new malicious dependency, PatchPilot now detects:

| Check | What it catches | Threshold |
|-------|----------------|-----------|
| **Version Quarantine** | Recently published versions — suggests previous stable release | < 72 hours old |
| **New Package Detection** | Brand-new packages with no history | < 7 days old |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Schwellenwert für „New Package Detection“ stimmt nicht mit dem Code überein.

Auf Line 32 steht < 7 days old, aber src/registry.ts nutzt aktuell < 30 days. Diese Diskrepanz macht die Doku unzuverlässig.

Vorgeschlagene Korrektur
-| **New Package Detection** | Brand-new packages with no history | < 7 days old |
+| **New Package Detection** | Brand-new packages with no history | < 30 days old |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| **New Package Detection** | Brand-new packages with no history | < 7 days old |
| **New Package Detection** | Brand-new packages with no history | < 30 days old |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 32, Die README-Angabe "New Package Detection" (< 7 days
old) stimmt nicht mit der Implementierung in src/registry.ts (die aktuell < 30
days verwendet) überein; bitte synchronisieren: entweder aktualisiere die
README-Zeile für "New Package Detection" auf "< 30 days old" oder ändere den
Schwellenwert in src/registry.ts (die Konstante/Prüfung, z.B.
NEW_PACKAGE_THRESHOLD / die Altersprüfung in src/registry.ts) auf 7 Tage, und
stelle sicher, dass Tests/Docs entsprechend angepasst werden.

| **Low Downloads** | Packages with no community adoption (npm only) | < 100/week |

All three would have caught `plain-crypto-js`, the malicious package used in the Axios attack.

Supply chain checks return `ask` (not `deny`) — you decide whether to proceed. CVE-based blocks remain automatic.

## Installation

Expand Down Expand Up @@ -103,17 +116,22 @@ NODE_ENV=production npm install evil-pkg

## Decision Logic

| Severity | Action |
|----------|--------|
| CRITICAL or HIGH | **Block** - requires manual approval |
| MODERATE or LOW | **Allow** - with warning message |
| None found | **Allow** |
| Source | Severity | Action |
|--------|----------|--------|
| **CVE** | CRITICAL or HIGH | **Block** — requires manual approval |
| **CVE** | MODERATE | **Ask** — you decide |
| **CVE** | LOW | **Allow** — with warning |
| **Supply Chain** | Version < 72h / New package / Low downloads | **Ask** — you decide |
| None found | — | **Allow** |

Supply chain checks run in parallel with CVE checks (low added latency) and fail-open — if the registry is unreachable, installs proceed normally.

## Limitations

- **Homebrew**: OSV has no vulnerability database for Homebrew packages. Brew commands are detected but not checked.
- **Private registries**: Only public npm and PyPI packages are checked.
- **Offline**: Requires internet connection to query OSV API.
- **Offline**: Requires internet connection to query OSV API and package registries.
- **Zero-day CVEs**: Supply chain heuristics catch suspicious metadata patterns, but cannot detect all novel attack vectors.

## Development

Expand Down
Loading