solana-vulnerability-scanner

Scans Solana and Anchor programs for six critical vulnerability patterns.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/Ayoub-ouederni/SENTINEL --skill solana-vulnerability-scanner-ayoub-ouederni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solana-vulnerability-scanner
Source: https://github.com/Ayoub-ouederni/SENTINEL/tree/main/.claude/skills/solana-vulnerability-scanner
Command: npx skills add https://github.com/Ayoub-ouederni/SENTINEL --skill solana-vulnerability-scanner-ayoub-ouederni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Solana programs written in native Rust or the Anchor framework are exposed to platform-specific vulnerabilities like arbitrary CPI, improper PDA validation, and missing signer checks that generic smart contract auditors miss. This Skill systematically detects these six critical patterns before they become exploits. ## Core Features & Use Cases - Six Vulnerability Patterns: Detects arbitrary CPI, improper PDA validation, missing ownership checks, missing signer checks, sysvar spoofing, and improper instruction introspection. - Structured Audit Workflow: Guides a five-step scanning process covering CPI security, PDA validation, account validation, and instruction introspection with ripgrep commands. - Severity-Ranked Reporting: Produces findings with file locations, vulnerable code, attack scenarios, and Anchor-based fixes ranked Critical, High, or Medium. - Use Case: Before launching a Solana vault program, run this Skill to verify every CPI validates the program ID, every PDA uses the canonical bump, and every authority account requires a signature. ## Quick Start Audit the Solana programs in this repository for CPI, PDA, signer, and ownership vulnerabilities and report findings with fixes.

Frequently Asked Questions about solana-vulnerability-scanner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit a Solana program for security vulnerabilities?

Scan the program for six critical patterns: arbitrary CPI, improper PDA validation, missing ownership checks, missing signer checks, sysvar spoofing, and improper instruction introspection. Use ripgrep to locate invoke calls, PDA derivations, and account deserializations, then verify each against the validation checklist.

What is an arbitrary CPI vulnerability in Solana?

Arbitrary CPI occurs when a program calls invoke() or invoke_signed() with a user-controlled program ID without validating it first. An attacker can substitute a malicious program that impersonates the intended one, such as a fake SPL Token program, to steal funds or bypass logic.

Does this scanner work with both Anchor and native Solana programs?

Yes, it covers both native Rust Solana programs using solana_program and Anchor framework programs using anchor_lang. For Anchor, it checks that Program<'info, T>, Account<'info, T>, and Signer<'info> types are used so validation happens automatically.

How do I fix improper PDA validation in Anchor?

Use the seeds and bump constraints in the account attribute so Anchor validates the canonical bump automatically. In native programs, call find_program_address() instead of create_program_address() and compare the result against the provided account, storing the bump for reuse.

Why are sysvar checks only an issue before Solana 1.8.1?

Before Solana 1.8.1, functions like load_instruction_at() did not validate the sysvar account, letting attackers pass spoofed sysvars to fake instruction data. On 1.8.1 and later, use the checked variants load_instruction_at_checked() and load_current_index_checked().

What are the limitations of static Solana vulnerability scanning?

Pattern-based scanning cannot confirm exploitability or catch logic bugs outside the six encoded patterns. Findings should be verified with unit tests, Anchor integration tests using malicious inputs, and a local solana-test-validator deployment.