solana-vulnerability-scanner — Claude Code skill: how to install
Detects 6 critical vulnerabilities across native Rust and Anchor programs on Solana. Helps identify flaws in account validation, PDA derivation, and CPI logic.
npx skills add trailofbits/skills --skill solana-vulnerability-scanner -a claude-codeWhat solana-vulnerability-scanner does
The tool searches repository files for Rust sources and Anchor.toml configs. It checks code against six security patterns in the Solana execution model. These include unverified program IDs during CPI calls and improper bump calculations in PDA seeds.
The scan produces a coverage summary listing every tested pattern. The report highlights missing ownership checks prior to data decoding and omitted signer checks. Ready-to-use code fixes accompany each finding.
The sysvar rule targets projects using solana-program releases older than 1.8.1. Without Rust sources or Anchor definitions, the scanner will find nothing to evaluate.
What it helps with
- detect arbitrary cross-program invocation flaws with unverified targets
- verify account deserialization logic against missing owner checks
- spot program-derived address derivation using arbitrary bumps
- flag state modifications missing signer authentication
Example prompts for the agent
- Scan
programs/for unsafe cross-program invocations and unverified PDA derivations - Audit the Anchor accounts struct to ensure signer constraints are in place
- Review Solana program instructions for instruction introspection flaws
How to install solana-vulnerability-scanner
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill solana-vulnerability-scanner -a claude-code2Manually: put the files in place
~/.claude/skills/solana-vulnerability-scanner/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/solana-vulnerability-scanner/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill solana-vulnerability-scanner -a codex2Manually: put the files in place
.agents/skills/solana-vulnerability-scanner/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill solana-vulnerability-scanner -a cursor2Manually: put the files in place
.cursor/skills/solana-vulnerability-scanner/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install trailofbits/skills solana-vulnerability-scanner2Manually: put the files in place
.github/skills/solana-vulnerability-scanner/SKILL.md1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill solana-vulnerability-scanner -a gemini-cli2Platform CLI
gemini skills install https://github.com/trailofbits/skills --path plugins/building-secure-contracts/skills/solana-vulnerability-scannerManually: put the files in place
.devin/skills/solana-vulnerability-scanner/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add trailofbits/skills --skill solana-vulnerability-scanner -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about solana-vulnerability-scanner
How to install solana-vulnerability-scanner in Claude Code?
Run npx skills add trailofbits/skills --skill solana-vulnerability-scanner -a claude-code in your terminal. The configuration is placed at ~/.claude/skills/solana-vulnerability-scanner/SKILL.md.
What vulnerabilities does solana-vulnerability-scanner detect?
It checks six specific Solana weaknesses: arbitrary CPI targets, broken PDA bumps, unvalidated account owners, missing signer checks, spoofed sysvar inputs, and unsafe instruction introspection.
Does this skill require the Anchor framework?
No, it supports both Anchor and native Rust code using solana-program. The scanner adjusts its search depending on imports and attributes found in Cargo.toml and source files.