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-vectors172-config-not-snapshotted.md

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

172 — Live Config Read at Execute / Release Instead of a Snapshot

Severity: 6 (4–7; HIGH when an admin change can strand or seize committed funds; higher when a permissionless actor moves the parameter or can front-run the admin change) | Real: Zellic Pye — "fee can be front-run on deposit/withdraw" (High)

Two-step flows (request → keeper execute, unstake → claim, commit → reveal, order → fill) and custody flows (deposit/lock/stake → release) store the user's own parameters (KV-129 covers those) but read protocol terms — fee_bps, max_slippage, oracle, haircut, exchange_rate, lock_duration, exit_fee, hook, allowlist, pause — from live Config at execute/release. An admin or permissionless update between the steps applies terms the user never agreed to: a longer lock or a flipped allowlist strands funds; an exit fee raised toward 100 % seizes them. This generalises ECON-027 (retroactive fee), ECON-070 (settle before rate change) and the update_curve_params rule in references/methodologies/launchpads.md to every term.

Cross-ref: SM-080, OPS-094, KV-129, Rule 5b admin amplifier (race / retroactive).

Verification Procedure
rg -n 'struct\s+\w*(Request|Ticket|Pending|Order|Receipt|Lock)\b' programs/
rg -n 'config\.(fee|slippage|oracle|rate|haircut|ltv|bonus|lock_duration|exit_fee|hook|allowlist)' programs/ | rg -i 'execute|withdraw|unlock|claim|redeem|release|fill'

For each request/receipt type, list fields stored at step 1 and config.* reads at step N.

  • ✅ PASS: user-protective terms snapshotted at request/deposit (fee_bps_at_request, unlock_at, terms_hash, or config_version with require!(config.version == request.config_version) and penalty-free cancel); newly lowered safety limits deliberately re-read; setters monotonic in the user's favour or timelocked
  • ❌ FAIL: terms that decide whether/when/how much can leave are read live, and an admin setter has no bound or delay
// VULNERABLE
require!(now >= receipt.deposited_at + config.lock_duration, ErrorCode::Locked); // live read
// FIXED
receipt.unlock_at = now.checked_add(config.lock_duration).ok_or(ErrorCode::Math)?; // at deposit
require!(now >= receipt.unlock_at, ErrorCode::Locked);                              // at withdraw

Overall verdict:

  • ✅: committed users cannot be re-termed retroactively
  • ⚠️: re-termable, but the power is documented as a trust assumption and timelocked
  • ❌: retroactive re-terming possible

Sources: pashov/skills solidity-auditor/references/hacking-agents/invariant-agent.md and solidity-auditor/references/hacking-agents/execution-trace-agent.md in-flight config pattern (MIT, Copyright (c) 2024 AI Skills Contributors); qedgen/solana-skills skills/qedgen-auditor/references/category-catalog.md custody_terms_retroactive_mutation (MIT, Copyright (c) 2025 QEDGen) cross-linked as a generalisation; PlamenTSV/plamen agents/skills/solana/temporal-parameter-staleness/SKILL.md (MIT, Copyright (c) 2025-2026 Plamen Contributors); Zellic Pye [cited: https://reports.zellic.io/publications/pye/sections/fee-can-be-front-run-on-depositwithdraw-fee-frontrunning].

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