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-vectors029-withdraw-before-update-race.md

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

29 — Withdraw-Before-Update Race

Severity: 8 | Real: Multiple NAV-based funds, pricing oracle lag exploits

Withdraw executed with stale NAV → user gets more than entitled before price drop is reflected in the fund.

Verification Procedure

Step 1: Find NAV/price update mechanism

grep -rn --include="*.rs" -iE "update.*nav\|attest\|refresh.*price\|update.*value" programs/*/src/instructions/
  • Record: How and when NAV is updated

Step 2: Verify NAV freshness at withdrawal time

grep -rn --include="*.rs" -iE "nav.*timestamp\|last.*update\|stale\|freshness\|max_age\|valid_until" programs/*/src/instructions/
  • ✅ PASS: Withdrawal checks that NAV was updated within acceptable window (e.g., last 5 min)
  • ❌ FAIL: Withdrawal uses NAV without checking when it was last updated

Step 3: Check withdrawal state machine (multi-step withdrawal protocols)

grep -rn --include="*.rs" -iE "initiate.*withdraw\|mark_ready\|finalize.*withdraw\|withdrawal.*state" programs/
  • ✅ PASS: Multi-step withdrawal (initiate → ready → finalize) with NAV checkpoint at finalize
  • ❌ FAIL: Single-step withdrawal that uses whatever NAV is stored

Step 4: Verify NAV update cannot be skipped before finalization

# Check: can finalize_withdrawal be called without a recent NAV update?
grep -rn --include="*.rs" -A20 "pub fn finalize" programs/*/src/instructions/
  • ✅ PASS: finalize requires NAV attestation timestamp to be recent
  • ❌ FAIL: finalize works regardless of NAV freshness

Overall verdict:

  • ✅: Multi-step withdrawal with NAV freshness check at finalization
  • ⚠️: Multi-step but NAV freshness window is too wide (hours)
  • ❌: Single-step withdrawal or no NAV freshness check

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