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-vectors028-front-running-transaction.md

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

28 — Front-Running Transaction

Severity: 6 | Real: Widespread in DeFi, Solana MEV via Jito bundles

Attacker sees pending transaction, submits theirs first to profit from price impact.

Verification Procedure

Step 1: Identify time-sensitive operations

grep -rn --include="*.rs" -iE "swap|trade|deposit|withdraw|claim|liquidat" programs/*/src/instructions/
  • Record: All time-sensitive instructions

Step 2: Check for commit-reveal pattern

grep -rn --include="*.rs" -iE "commit|reveal|hash|preimage|nonce" programs/
  • ✅ PASS: Sensitive operations use commit-reveal or are not vulnerable to ordering
  • ⚠️ PARTIAL: No commit-reveal but slippage protection mitigates the impact
  • N/A: Operations are not price-sensitive

Step 3: Verify slippage protection on swaps (see Hack #7)

  • ✅ PASS: Slippage protection prevents profitable front-running
  • ❌ FAIL: No slippage tolerance on price-sensitive operations

Step 4: Check for private/priority transaction support

grep -rn --include="*.ts" -iE "jito|priority_fee\|priorityFee\|computeUnitPrice" apps/
  • ✅ PASS: Supports Jito bundles or priority fees for MEV protection
  • ⚠️ PARTIAL: No explicit MEV protection but slippage limits impact

Step 5: Taker-side bounds on counterparty- or admin-mutable parameters

rg -n 'pub fn (update|set|change)_(price|fee|rate|ask|params)' programs/
  • ✅ PASS: each consumer instruction (buy, fill, withdraw, redeem) takes a bound (max_price, max_fee_bps, min_out) or a version/nonce and compares it (require! or assert! — both abort atomically), or changes are delayed
  • ❌ FAIL: the consumer pays whatever the stored value is at execution (ECON-102)

Sources: Helius "A Hitchhiker's Guide to Solana Program Security", "Frontrunning" section [paraphrased, cited: https://www.helius.dev/blog/a-hitchhikers-guide-to-solana-program-security].

Overall verdict:

  • ✅: Slippage protection + priority fees/bundles
  • ⚠️: Slippage only (most common adequate protection)
  • ❌: No slippage or commit-reveal on price-sensitive operations

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