cc-plugin-audit
Supply-chain security for Claude Code plugins. Detects when marketplace plugins auto-update and surfaces security-relevant diffs at session start.
The Problem
Claude Code plugins execute with full user permissions — shell access, file system, hooks, MCP servers. But marketplace plugins auto-update silently with no integrity verification, no diff review, and no user notification.
A compromised marketplace repo or maintainer account can push malicious code that runs on your machine the next time you start a session. This has been demonstrated by security researchers and is tracked as an open issue (anthropics/claude-code#29729).
This plugin closes that gap until native signing/verification lands in Claude Code.
How It Works
SessionStart
│
▼
Scan ~/.claude/plugins/cache/<marketplace>/<plugin>/<version>/
│
▼
SHA-256 hash each plugin's latest version directory
│
▼
Compare against saved manifest (~/.claude/plugin-audit/manifest.json)
│
├── No changes → silent exit (zero overhead)
│
├── New plugin → note in session context
│
└── Plugin changed →
├── Diff security-relevant files between old and new version
├── Save full diff to ~/.claude/plugin-audit/diffs/
└── Inject warning + diff into session context
The first session after install seeds the manifest silently. Subsequent sessions flag any changes.
What Gets Flagged
The audit focuses on files that can execute code or alter Claude's behavior:
| Category | Files | Risk |
|---|
| Hook scripts | *.sh, *.py, *.js, *.ts | Arbitrary code execution |
| Hook config | hooks.json | Controls what events trigger code |
| Plugin manifest | plugin.json | Permissions, MCP server declarations |
| MCP config | .mcp.json, mcp.json | Network access, external tool exposure |
| Instructions | SKILL.md, CLAUDE.md, AGENTS.md | Behavioral manipulation |
| Commands | commands/*.md | Slash command behavior changes |
| Agent definitions | agents/*.md | Subagent behavior changes |
Non-security files (README, CHANGELOG, etc.) are tracked in the overall hash but not individually diffed.
Threat Indicator Scanner
Beyond diffing, the audit scans all security-relevant file contents for known attack patterns based on documented real-world exploits:
| Severity | Indicator | Based on |
|---|
| CRITICAL | curl | bash download-execute | ClawHavoc, MedusaLocker |
| CRITICAL | Unicode Tag injection (invisible instructions) | ClawHavoc campaign (341 malicious skills) |
| CRITICAL | base64 -d | eval encoded payloads | Snyk ToxicSkills (76 confirmed) |
| CRITICAL | Settings/permission file writes | PromptArmor |
| CRITICAL | ANTHROPIC_BASE_URL override | CVE-2026-21852 |
| CRITICAL | enableAllProjectMcpServers | CVE-2025-59536 |
| CRITICAL | bypassPermissions mode | CVE-2026-33068 |
| CRITICAL | PreToolUse auto-approve hooks | PromptArmor |
| HIGH | Credential path access (~/.ssh/, ~/.aws/) | Snyk ToxicSkills |
| HIGH | npx -y MCP server auto-install | Theoretical |
| HIGH | Password-protected archive extraction | Snyk ToxicSkills |
| HIGH | Prompt injection phrases | OWASP Agentic Security |
| HIGH | Symlink creation | CVE-2025-53109 |
| HIGH | Custom package registry URLs | Prompt Security |
| MEDIUM | Bash validator bypasses (sed e, $IFS, @P) | CVE-2025-66032 |
| MEDIUM | External URLs | Defense in depth |
Example Output
When a plugin updates with suspicious content, the session context gets one line per plugin:
PLUGIN UPDATE AUDIT — open the report for any plugin whose counts or changed files you did not expect:
popular-market/trusted-tool 1.0.0 -> 1.0.1: 1 critical, 1 high; security files changed
Details and diffs: ~/.claude/plugin-audit/reports/20261027-091709-plugin-update.md
A plugin with no indicator matches still says whether its security-relevant files changed, so "no indicator matches" never reads as "nothing to look at". When there is no previous version to diff (in-place change, cleaned cache) or the diff fails, the line says security-file change unverified rather than claiming nothing changed. The most severe plugins are listed first and the 5-line cap only ever drops clean ones; anything dropped is summarized as a severity total plus how many of them have security-file changes or unverified state.
The full report on disk carries the indicators and the security-relevant diff: