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.

known-vectors177-declared-intent-unenforced.md

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

177 — Declared Intent the Code Never Enforces

Severity: inherits the ceiling of the path the dead guard fails to protect (e.g. HIGH for an unwired authority check on a privileged CPI); 5 by default | Real: qedgen benchmark corpus (repeatedly missed on cold reads)

The author named an invariant but nothing enforces it, so there is no guard to find a gap in: (1) a constant defined but never read (MIN_PAYOUT_LAMPORTS); (2) a config field written at init and never read; (3) a mode/enum parameter persisted but never branched on ("quote-only" behaves like "both"); (4) an #[error_code] variant with zero raise sites; (5) a match arm treating variants identically when the docs say one is partial.

Cross-ref: FULL-AUDIT Step 1.5 P4, SM-005, SM-077.

Verification Procedure
# unwired error variants
for v in $(rg -o '^\s+[A-Z][A-Za-z0-9]+' programs/*/src/error*.rs | awk '{print $NF}'); do
  n=$(rg -n "::$v\b|err!\(.*$v|error!\(.*$v" programs/ --type rust | rg -v 'error.rs' | wc -l)
  [ "$n" = 0 ] && echo "UNWIRED $v"; done
# error enums in errors.rs / error/mod.rs / lib.rs: adjust the path; `::$v` also catches custom enum names

Also run cargo check for dead-code warnings (Rule 11f). Note that rustc does not warn on unused pub items in a library crate (Anchor programs are lib/cdylib), so an unread pub const or error variant needs the grep, not the warning. Grep each config field for readers outside init. Search the README, doc comments and bounty text for must|only|always|never|at most|within|per day, and confirm each claim in the code.

  • ✅ PASS: every declared constraint has an enforcement site, or is documented as not enforced
  • ❌ FAIL: a security-relevant declared constraint is unenforced

Overall verdict: ✅ intent enforced · ❌ dead guard on a value or authority path

Sources: qedgen/solana-skills skills/qedgen-auditor/references/manual-review-passes.md §3f dead-guard / intent-drift sweep and skills/qedgen-auditor/references/category-catalog.md bounty_intent_drift (MIT, Copyright (c) 2025 QEDGen).

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