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-vectors179-onchain-secret-low-entropy-commitment.md

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

179 — On-Chain Secrets & Low-Entropy Commitments

Severity: 7 | Real: Ackee Solana Auditors Bootcamp (revival-attack, arbitrary-cpi, type-cosplay, CTF levels 1, 2, 4)

All account data, instruction arguments, msg! logs and historical transactions are public. Traps: (1) a "secret" stored in account data (readable with getAccountInfo; a "cleared" secret remains in history); (2) a plaintext argument checked on-chain (the first honest use reveals it, and anyone observing the transaction before it lands can reuse it); (3) a hash of low-entropy input (hash(pin_u8 × 4) is 2^32 tries — seconds on a GPU, minutes on one CPU core; a hash(u64) passcode is not low-entropy, but revealing it in instruction data is still fatal); (4) msg! of sensitive values or other accounts' data.

Cross-ref: KV-120, KV-101/102.

Verification Procedure
rg -n -i '(pin|secret|password|passcode|passphrase|seed_phrase|private)[0-9_a-z]*\s*:' programs/*/src
rg -n 'hashv?\(.*(to_be_bytes|to_le_bytes|as_bytes)\(\)' programs/
rg -n 'msg!\(' programs/ | rg -i 'secret|pin|key|seed'
  • ✅ PASS: authentication by signatures only (Signer, or the ed25519 precompile with introspection per KV-101/102); commit-reveal commits to hash(value ‖ 32-byte random salt ‖ signer) and binds the reveal to the committing signer
  • ❌ FAIL: any shared secret gating value

Overall verdict: ✅ no secret-based gate · ❌ value gated on public or brute-forceable data

Sources: Ackee-Blockchain Solana-Auditors-Bootcamp Lesson-6/revival-attack, Lesson-6/arbitrary-cpi, Lesson-6/type-cosplay and Capture-the-Flag/ levels [paraphrased, cited: https://github.com/Ackee-Blockchain/Solana-Auditors-Bootcamp/tree/master], timing and level-5 example corrected.

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