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-vectors008-rug-pull-admin-backdoor.md

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

8 — Rug Pull / Admin Backdoor

Severity: 10 | Real: Merlin DEX ($1.8M), billions annually in crypto rug pulls

Hidden admin function drains vault, mints infinite tokens, pauses withdrawals forever, or redirects fees to attacker.

Verification Procedure

Step 1: List ALL admin-only functions

grep -rn --include="*.rs" "pub fn" programs/*/src/instructions/ | grep -viE "test"
  • For each function: identify if it's admin-only (requires specific authority signer)
  • Record: Complete list of admin functions with their powers

Step 2: Check for unrestricted withdrawal by admin

grep -rn --include="*.rs" -iE "withdraw.*admin\|admin.*withdraw\|emergency.*withdraw\|drain" programs/
  • ✅ PASS: Admin cannot withdraw investor funds (only performance fees or admin fees from designated accounts)
  • ❌ FAIL: Admin can withdraw arbitrary amounts from the main vault

Step 3: Check for unrestricted mint authority

grep -rn --include="*.rs" "mint_to\|MintTo" programs/ | grep -v test
  • For each mint_to: verify it's constrained (e.g., only during deposit proportional to deposit amount)
  • ✅ PASS: Every mint is proportional to a deposit or earned fee, with correct math
  • ❌ FAIL: Admin can mint arbitrary shares

Step 4: Check if admin can pause withdrawals permanently

grep -rn --include="*.rs" -iE "pause|freeze|lock|disable.*withdraw" programs/
  • ✅ PASS: No pause mechanism, or pause has timelock/governance, or users can always withdraw after timeout
  • ❌ FAIL: Admin can pause withdrawals with no time limit or override

Step 5: Check for hardcoded admin addresses

grep -rn --include="*.rs" "Pubkey::new_from_array\|pub const.*Pubkey" programs/
  • ✅ PASS: Admin/authority is stored on-chain in state (can be verified by anyone) and set during init
  • ❌ FAIL: Hardcoded addresses that can't be audited or verified

Step 6: Check fee redirection capability

grep -rn --include="*.rs" -iE "fee.*destination\|treasury\|fee.*recipient\|fee.*account" programs/
  • ✅ PASS: Fee destination is immutable (set at fund creation) or requires multi-party approval to change
  • ❌ FAIL: Admin can silently redirect fees to any address

Step 7: Check upgrade authority

# In deployed program: who can upgrade?
grep -rn "upgrade_authority\|authority.*program" Anchor.toml
  • ✅ PASS: Upgrade authority is multisig, governance, or revoked (immutable)
  • ⚠️ PARTIAL: Single key upgrade authority with hardware wallet
  • ❌ FAIL: Single hot wallet controls upgrades

Overall verdict:

  • ✅: Admin powers are limited and transparent, no vault drain, no infinite mint, upgrade is secure
  • ⚠️: Admin powers are appropriate but upgrade authority is single key
  • ❌: Admin can drain vault, mint unlimited shares, or pause withdrawals permanently

See also: behaviour that differs between simulation and execution defeats wallet previews (OPS-095).

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