Index of every page on this site: llms.txt
All skills
princedotrs avatar

/solana-program-audit

@586e19e
Run it yourself

Security audit of Solana on-chain programs in Rust: Anchor, native solana-program and Pinocchio. Use to audit or review a Solana program, PR or fix and to find vulnerabilities: missing signer or owner checks, account validation, type cosplay, reinitialization, init front-running, closed-account revival, duplicate accounts, PDA seeds and bumps, arbitrary CPI, CPI return data, remaining_accounts, sysvar and instruction introspection, overflow, rounding, Token-2022 extensions and transfer hooks, oracle, flash-loan and MEV attacks, upgrade authority and governance. Covers DeFi reviews (AMM, lending, perps, staking, bridges, launchpads), PoC exploits, fix patches, re-audits, spec compliance, audit readiness, release gates and audit reports. Trigger on code using anchor_lang, solana_program, pinocchio, #[program], #[derive(Accounts)] or entrypoint!. Not for writing features, off-chain clients or backends, EVM/Solidity, or incident response.

  • 237 files
  • 2 MB
  • Updated 4 weeks ago
  • GitHub
Use this Skill: https://skilld.dev/gh/princedotrs/solana-audit/solana-program-audit

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescompose-cookbook.md

≈714 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Composition cookbook (thinking prompts, not automatic severity)

Use in FULL-AUDIT Step 1.6. A chain is reported once at the chain's severity with every component linked. Do not compose with a primitive absent from this code.

Primitive A + Primitive B = Chain ceiling
Missing signer Arbitrary CPI account takeover via forged CPI authority (CRIT)
Missing signer / permissionless Unvalidated close destination drain rent and state from any closable PDA (CRIT)
Type confusion Missing owner check forged-data trust (CRIT)
PDA seed collision Missing signer take over another user's PDA (CRIT)
Non-canonical bump Signer-derived seeds program signs for / accepts an alternate PDA for the same seeds — duplicate state / impersonation (HIGH)
Permissionless init Unanchored stored authority/fee field (KV-148) front-run init, capture every fee or withdrawal (CRIT)
Root-unanchored account chain (KV-146) Typed-but-unanchored CPI authority mint/withdraw under the real authority against fake collateral (CRIT)
Role token account unanchored (KV-147) Authority-signed payout authority redirects a passive role's funds (CRIT)
Payout > principal (KV-176) Shared vault + permissionless claim per-position leak becomes a pool drain (HIGH→CRIT)
Custody terms retroactive (KV-172) Single-key admin, no timelock instant strand/seize of deposits (HIGH→CRIT)
Privileged action with no delay Durable-nonce pre-signed approval months-old approval lands instantly, no revoke window (MED→CRIT)
Transfer hook (untrusted callee) Caller invariant false across the transfer hook acts on inconsistent state via third programs, not re-entry (HIGH→CRIT)
Lamport balance used as accounting withdrawable = lamports() − rent donate, withdraw a surplus never deposited (HIGH)
Payout to stored address Address later executable or reserved permanent DoS of the payout handler (MED→HIGH)
Parent full-delete close (KV-175) Children not closed stale children revive under the re-created parent
Saturating by design Amount-shaped field + permissionless caller silent value loss, no error path (MED→HIGH)
Closable account (revival) Token-program quirk + missing post-condition small issues chained into a drain (Solens "Royal Flush" shape)
Spec/docstring claims X, code does not enforce Formal proof generated from that spec green proof of broken behaviour (HIGH)

Sources: qedgen/solana-skills skills/qedgen-auditor/references/category-catalog.md "Compose-with-what cookbook" (MIT, Copyright (c) 2025 QEDGen), rewritten; sannykim/solsec → Solens "Royal Flush" [paraphrased, cited: https://medium.com/@solens_io/schrodingers-nft-an-incinerator-spl-token-program-and-the-royal-flush-attack-58e4ce4e63dc].

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 586e19e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 4 weeks ago

README badge

README badge for princedotrs/solana-audit