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-vectors016-token-account-mismatch.md

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

16 — Token Account Mismatch

Severity: 8 | Real: Multiple DeFi fund-drain exploits

Program transfers to wrong token account — mint mismatch means funds sent to attacker's account of a different token.

Verification Procedure

Step 1: Find all token transfers

grep -rn --include="*.rs" "token::transfer\|transfer_checked\|Transfer {" programs/*/src/instructions/
  • Record: Every transfer with source and destination accounts

Step 2: Verify mint constraint on every token account

grep -rn --include="*.rs" "token::mint\|constraint.*\.mint" programs/*/src/instructions/
  • For each token account in each instruction: verify token::mint = expected_mint constraint exists
  • ✅ PASS: Every TokenAccount has a mint constraint matching the expected token
  • ❌ FAIL: Any TokenAccount accepted without mint verification

Step 3: Verify authority constraint on source accounts

grep -rn --include="*.rs" "token::authority" programs/*/src/instructions/
  • ✅ PASS: Transfer source accounts have token::authority = expected_authority (PDA or signer)
  • ❌ FAIL: Source account authority not verified (attacker could pass their own account as destination)

Step 4: Cross-reference transfer source/destination

  • For each transfer: verify the from account belongs to the fund/vault and to is the expected recipient
  • Read the actual transfer instruction and trace the accounts
  • ✅ PASS: Every transfer has verified source and destination with mint match
  • ❌ FAIL: Destination could be attacker-controlled account with different mint

Overall verdict:

  • ✅: Every token account has mint + authority constraints, all transfers verified
  • ⚠️: Mint constraints present but authority missing on some accounts
  • ❌: Token accounts without mint constraint allow cross-mint attacks

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