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-vectors017-vault-donation-attack.md

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

17 — Vault Donation Attack

Severity: 7 | Real: ERC-4626 vault exploits, Yearn vault donation

Attacker sends tokens directly to vault (bypassing deposit instruction) to inflate share price, then redeems at inflated price.

Verification Procedure

Step 1: Identify how vault balance is computed

grep -rn --include="*.rs" -iE "vault.*balance\|vault.*amount\|get_lamports\|token_account\.amount\|total_assets\|total_value" programs/
  • Record: Whether NAV/share-price uses raw vault balance or tracked deposits

Step 2: Check if deposits are tracked separately from balance

grep -rn --include="*.rs" -iE "total_deposited\|tracked_balance\|internal_balance\|total_capital" programs/*/src/state/
  • ✅ PASS: Program tracks deposits/withdrawals in state — share price uses tracked amount, not raw balance
  • ❌ FAIL: Share price directly reads vault token account balance (donatable)

Step 3: Verify NAV attestation (vault/fund protocols)

grep -rn --include="*.rs" -iE "attest\|nav_value\|total_value.*param\|update_nav" programs/*/src/instructions/
  • ✅ PASS: NAV submitted via attested off-chain oracle, not read from vault balance
  • ⚠️ PARTIAL: NAV uses vault balance but has donation detection
  • ❌ FAIL: NAV = sum of vault token accounts (directly manipulable)

Step 4: Check for excess balance detection

# Does the program detect and handle unexpected balance increases?
grep -rn --include="*.rs" -iE "expected.*balance\|excess\|donation\|unexpected" programs/
  • ✅ PASS: Program detects and ignores unexpected balance increases
  • ❌ FAIL: All balance increases are treated as deposits

Overall verdict:

  • ✅: Tracked deposits separate from balance, or attested NAV, or donation detection
  • ⚠️: Most calculations use tracked values but some edge cases use raw balance
  • ❌: Share price computed from raw vault balance without donation protection

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