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-vectors013-missing-signer-check.md

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

13 — Missing Signer Check

Severity: 10 | Real: Wormhole ($326M), Parity multi-sig ($31M)

Instruction accepts accounts but doesn't verify the expected signer actually signed the transaction. Anyone can impersonate the authority.

Verification Procedure

Step 1: List all instructions and count signers

for f in programs/*/src/instructions/*.rs; do
  echo "=== $f ==="
  grep -c "Signer<'info>" "$f"
  grep "pub fn " "$f"
done
  • Record: Each instruction and its signer count

Step 2: Verify every mutation instruction has at least one signer

grep -rn --include="*.rs" "pub fn " programs/*/src/instructions/ | while read line; do
  file=$(echo "$line" | cut -d: -f1)
  grep -c "Signer<'info>" "$file"
done
  • ✅ PASS: Every instruction that modifies state has ≥1 Signer
  • ❌ FAIL: Any mutation instruction with 0 Signers

Step 3: Verify signer is the CORRECT authority

grep -rn --include="*.rs" -A5 "pub.*authority.*Signer\|pub.*manager.*Signer\|pub.*admin.*Signer" programs/*/src/instructions/
  • For each signer: verify has_one = authority (or equivalent) links it to the stored authority in the account being modified
  • ✅ PASS: Every signer is validated against the expected authority stored on-chain
  • ❌ FAIL: Signer is accepted but not checked against stored authority (any wallet can sign)

Step 4: Look for authority spoofing via separate accounts

# Check if authority account is separate from the entity being modified
# Attacker could pass their own account as authority if not linked
grep -rn --include="*.rs" "has_one\|constraint.*authority\|constraint.*manager" programs/*/src/instructions/
  • ✅ PASS: Declarative constraints link signer to state
  • ❌ FAIL: Authority is a standalone Signer with no link to program state

Overall verdict:

  • ✅: Every mutation has a Signer linked to the correct on-chain authority via has_one
  • ⚠️: Signers present but not all have has_one (only runtime checks)
  • ❌: Any instruction accepts any signer without linking to stored authority

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