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-vectors005-oracle-manipulation.md

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

5 — Oracle Manipulation

Severity: 9 | Real: Cream ($130M), Compound ($80M), Mango ($114M)

Attacker manipulates price feed → protocol values collateral incorrectly → drain.

Verification Procedure

Step 1: Identify all price sources

grep -rn --include="*.rs" -iE "price|oracle|pyth|switchboard|feed|quote" programs/
  • Record: Every place where a price is read or referenced

Step 2: Check oracle type

  • ✅ PASS: Uses Pyth, Switchboard, or Chainlink with TWAP
  • ⚠️ PARTIAL: Uses Pyth spot price without TWAP
  • ❌ FAIL: Price derived from DEX pool reserves or token account balance

Step 3: Verify oracle freshness check

grep -rn --include="*.rs" -iE "stale|age|timestamp|valid_until|max_age|confidence" programs/
  • ✅ PASS: Code checks that oracle update timestamp is within acceptable window (e.g., < 60s old) AND confidence interval is acceptable
  • ❌ FAIL: Oracle price used without checking timestamp or confidence

Step 4: Verify oracle account owner is checked

# Oracle account should be verified as owned by the oracle program (e.g., Pyth program ID)
grep -rn --include="*.rs" -B5 -A5 "oracle\|price_feed\|price_account" programs/*/src/instructions/
  • ✅ PASS: Oracle account has owner constraint (e.g., owner = pyth_program_id)
  • ❌ FAIL: Oracle account is UncheckedAccount or no owner validation

Step 5: Check for price manipulation via donation (vault/fund protocols)

grep -rn --include="*.rs" "token_account.*amount\|get_lamports\|vault.*balance" programs/
  • If NAV is computed from token balances: verify it can't be inflated by sending tokens directly to the vault
  • ✅ PASS: NAV uses external attestation, not raw vault balance
  • ❌ FAIL: NAV = vault balance (attackable by donating tokens)

Overall verdict:

  • ✅: External oracle with TWAP, freshness check, owner validation, no balance-derived prices
  • ⚠️: Oracle used but missing freshness OR confidence checks
  • ❌: Prices from manipulable sources (pool reserves, vault balance)

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