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-vectors103-address-lookup-table-manipulation.md

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

103 — Address Lookup Table (ALT) Manipulation

Severity: 7 | Real: Versioned-transaction account substitution via attacker-supplied lookup tables

Versioned (v0) transactions resolve some accounts by index into one or more Address Lookup Tables supplied by the transaction author. The runtime still enforces signer/writable flags and program ownership, but a program that trusts account ordering or positional assumptions — rather than re-deriving and asserting each account's address — can be fed substituted accounts through a malicious ALT. This is most dangerous for remaining_accounts, for "config"/"authority"/"treasury" accounts that are not has_one-bound, and for off-chain clients that build instructions assuming a fixed account list.

Scope note (transaction v1, SIMD-0385): v1 transactions carry no lookup tables — all ≤ 64 accounts are inline and duplicates are rejected at sanitization. The ALT substitution path below applies to v0 only; the underlying rule (bind privileged accounts by derivation, never by position) applies to every version, and v1 raises the positional surface to 64 inline accounts and 64 instructions (AV-090, references/vuln-classes/transaction-v1.md).

Verification Procedure

Step 1: Identify positional / ordering assumptions

grep -rn --include="*.rs" -E "remaining_accounts|ctx.accounts\.[a-z_]+\.key\(\)|accounts\[[0-9]+\]" programs/*/src/instructions/
  • Record any logic that depends on account position or an unconstrained account identity

Step 2: Verify every security-relevant account is bound, not positional

  • ✅ PASS: Treasury/authority/config/mint accounts are validated via has_one, seeds+bump, address = …, or require_keys_eq! — never "whatever is in slot N"
  • ❌ FAIL: A privileged account's identity is assumed from ordering and can be swapped via ALT

Step 3: Validate remaining_accounts independent of resolution path

  • ✅ PASS: Each remaining account is re-derived (PDA) or owner/mint/authority-checked before use (see AV-032..039)
  • ❌ FAIL: Remaining accounts trusted by index — ALT can substitute them

Step 4: Check client-side instruction construction

grep -rn --include="*.ts" -iE "lookupTable|AddressLookupTable|TransactionMessage|compileToV0Message" apps/ packages/
  • ✅ PASS: Clients pin known ALTs or do not rely on ALT-resolved accounts for security decisions
  • ❌ FAIL: Clients accept arbitrary ALTs that feed privileged accounts

Overall verdict:

  • ✅: No positional trust; every privileged account is cryptographically bound
  • ⚠️: Mostly bound, but some unconstrained config accounts resolved positionally
  • ❌: Privileged accounts or remaining_accounts trusted by position — ALT substitution possible

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