- Home
- Skills
- Web3 & Crypto
- Solana Security Review
Solana Security Review
Audit-style security review for Solana programs (Anchor or native): maps every instruction, scans 15 bug classes, walks a 45-point checklist, proves Highs and writes a report with severities and code fixes.
$9
Works with the AI Agents you already use
Solana Security Review
Example session with this skill installed
Review my Anchor program in onchain/programs/curve_market for security issues before we go to mainnet. It's a parimutuel market on whether a Meteora bonding-curve pool graduates by a deadline.
- Read your context and instructions
- Compiled the solana security review
Summary
curve_market (Anchor, 4 instructions: create_market, stake, resolve, claim) holds user funds in a PDA vault and pays winners pro rata.
No Critical, High or Medium issues found. One Info finding. All 10 scanner leads were traced and dismissed. overflow-checks is ON in the release profile.
| ID | Title | Severity |
|---|---|---|
| I-1 | Rounding dust stays in the vault forever | Info |
Attack surface
| Instruction | Signer | Notes |
|---|---|---|
| create_market | creator | pool/config are UncheckedAccount, verified in dbc::read_pool / read_config |
| stake | user | position is init_if_needed, PDA per (market, user) |
| resolve | none (permissionless) | outcome read from the pool account itself |
| claim | user | closes position to user |
Invariants checked
- Only the position owner can claim it: PDA seeds [POSITION_SEED, market, user] + user is Signer. Holds.
- Total paid out never exceeds the pool:
require!(market.paid_out <= total_pool)after each claim. Holds. - A position cannot be claimed twice:
claimedflag set before transfer, and the account is closed. Holds. - Stakes credit what the vault actually received: balance delta after
transfer_checked+reload(), so a Token-2022 transfer fee cannot inflate a position. Holds.
I-1: Rounding dust stays in the vault forever
Location: src/lib.rs:56 (payout_for)
payout = winning_stake * total_pool / winning_total rounds down, which is the safe direction. The remainder (at most one unit per winning position) is never swept: there is no instruction to recover it once every position has claimed. Over many markets this strands small amounts.
Recommendation: add a permissionless sweep after all positions are claimed (track a claim count), or let the last claimant take the remainder.
Scanner leads dismissed
| Lead | Location | Why not an issue |
|---|---|---|
| init_if_needed | lib.rs:420 | Fields are only set when position.owner == Pubkey::default(); PDA is unique per user, so nobody can pre-create or reset another user's position |
| UncheckedAccount pool/config (x4) | lib.rs:369, 373, 461, 464 | read_pool / read_config check owner == DBC program, discriminator and length; config key must equal pool.config |
| div-rounding | lib.rs:64 | Rounds down on payouts (favours the vault) |
| unix_timestamp (x3) | lib.rs:128, 179, 257 | Deadline checks are consistent (stake allowed now <= deadline, resolve after) |
Next steps
- Decide on I-1 (sweep or last-claimant remainder) and add a test for it.
- Freeze or multisig the upgrade authority before mainnet.
- Run
solana-verifyon the deployed build so users can match it to this commit.
Connects securely to your tools. The creator never sees your data.
About this skill
A security review of your Solana program, done the way an auditor works through it, not a vague "looks fine to me".
What it does
- Maps the attack surface.
map_program.pylists every instruction with its accounts and their constraints (signer, mut, has_one, seeds, owner,/// CHECK), and flags permissionless instructions and unchecked accounts on one page. - Scans for risky patterns.
scan.pyflags 15 bug classes with file:line: unchecked accounts, CPIs to a caller-chosen program, non-canonical bumps, manual lamport closes,init_if_needed,remaining_accounts, unchecked arithmetic (and whetheroverflow-checksis on), lossyascasts, rounding, sysvar spoofing,transfervstransfer_checked, and more. - Walks every instruction through a 45-point checklist: access control, account validation, PDAs, arithmetic, token and Token-2022 handling, CPI, account lifecycle, economic logic, upgrade authority.
- Proves what it reports. Every High or Critical needs a traced path and a failing test or exact exploit steps. Scanner leads that turn out safe are listed as dismissed, with the reason.
- Writes the report in audit format: summary table, severity (Critical to Info), location, impact, proof and a code fix.
Built for
- Teams going to mainnet who want a first pass before paying for an audit
- Bug bounty hunters triaging a new Immunefi program fast
- Hackathon teams who need a security section that holds up
Works on Anchor and native Rust. Scripts are Python standard library only: nothing to install, nothing sent anywhere. The agent never deploys or sends transactions during a review.
Includes bad/good code pairs for each vulnerability class (missing signer binding, owner/type confusion, arbitrary CPI, duplicate mutable accounts, share inflation, account revival, stale state after CPI, Token-2022 transfer fees, oracle staleness).
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Web3 & Crypto.
Requires valid Rust/Anchor project structure. High-severity findings require manual verification of the code path. Scanners identify leads, not confirmed exploits.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
- Software
Python 3.8+
Permissions
Terminal: runs the two local Python scripts. Read files: reads the program source under review. Nothing is written except the report the user asks for, and no network access is needed.