Solana Anchor & Rust Cross-Program Invocation (CPI) Vulnerability Scanner
scan_solana_cpi_reentrancyScans Solana Anchor and native Rust program instructions for unverified Cross-Program Invocation (CPI) program IDs, missing signer checks, and PDA bump seed canonicalization bugs. Use when auditing Solana Rust/Anchor source code or instruction account structs for CPI privilege escalation; for checking live SPL token mint/freeze authorities and rug-pull risk by mint address, use evaluate_solana_token_risk instead. Read-only edge call (32 KB, 60 RPM): accepts 'rust_source_or_idl' ('framework' defaults to 'anchor'), uses '?demo=true' or L402 (30 sats); HTTP 400 if invalid.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"rust_source_or_idl": "<rust_source_or_idl>"
},
"name": "scan_solana_cpi_reentrancy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| framework | No | Solana program framework used; defaults to 'anchor' when omitted. | |
| rust_source_or_idl | Yes | Solana Rust/Anchor source code or IDL JSON string to scan for CPI vulnerabilities. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audit_verdict | Yes | Overall Solana program verdict ('SAFE_ANCHOR_PROGRAM' or 'CRITICAL_CPI_VULNERABILITY'). | |
| pda_bump_safe | Yes | True when canonical bump seeds are enforced on all PDA derivations. | |
| missing_signer_checks | Yes | Accounts mutated without enforcing Signer<'info> or has_one constraints. | |
| arbitrary_cpi_detected | Yes | True if invoke/invoke_signed is called without validating the target program account. |