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-vectors018-fee-on-transfer-token-exploit.md

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

18 — Fee-on-Transfer Token Exploit

Severity: 7 | Real: Various DeFi protocols, ERC-20 fee tokens

Token deducts a fee on transfer — program credits the sent amount, not the received amount. Actual balance is less than recorded.

Verification Procedure

Step 1: Check if program handles any tokens besides SOL/WSOL

grep -rn --include="*.rs" "remaining_accounts\|token_mint\|new.*mint" programs/*/src/instructions/
  • If program only handles SOL/WSOL: N/A (SOL has no transfer fee)
  • If program handles arbitrary SPL tokens: proceed

Step 2: Check for post-transfer balance verification

grep -rn --include="*.rs" -B5 -A10 "transfer" programs/*/src/instructions/ | grep -iE "balance.*before\|balance.*after\|pre_balance\|post_balance"
  • ✅ PASS: Code snapshots balance before transfer, checks actual balance after, credits the difference
  • ❌ FAIL: Credits the transfer amount parameter without verifying received amount

Step 3: Check for Token-2022 transfer fee extension awareness

grep -rn --include="*.rs" "transfer_fee\|TransferFee\|transfer_checked" programs/
  • ✅ PASS: Uses transfer_checked which accounts for fees, or explicitly handles the fee extension
  • ❌ FAIL: Uses basic transfer without fee awareness

Step 4: Check allowlist for accepted tokens

grep -rn --include="*.rs" -iE "allowed.*mint\|whitelist\|accepted_token\|supported.*token" programs/
  • ✅ PASS: Program only accepts known tokens (e.g., WSOL, USDC) that don't have transfer fees
  • ⚠️ PARTIAL: No explicit allowlist, but fee tokens are unlikely
  • ❌ FAIL: Accepts any token without fee handling

Overall verdict:

  • ✅: Post-transfer balance check, or only accepts known non-fee tokens, or uses transfer_checked
  • ⚠️: Only handles known tokens but without explicit allowlist
  • ❌: Credits transfer amount without verifying received, accepts arbitrary tokens

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