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.

commandstriage.md

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

solana-program-audit — Batch Triage Checkpoint

Arguments: $ARGUMENTS

Run one consolidated triage pass over the candidate finding set, so calibration is a single auditable checkpoint instead of being diffused across the leaf reviewers. Read OUTPUT-RULES.md first — Rule 1 (severity 1–10, the "Notes & Nitpicks" tier below severity 1), Rule 5b (the validation gate + [UNCONFIRMED]/[UNDETERMINED] outcomes) — and references/false-positives.md (the triage catalog + the "quantify the barrier" symmetric-rejection rule). Re-run this after any new review phase adds candidates.

Input

The current candidate set — every [FAIL-N] / [PARTIAL] / [UNCONFIRMED] the reviewers have emitted this run (from audit_<n>/ worksheets / session findings). Triage is idempotent: re-running folds in new candidates without re-litigating settled ones.

Steps

  1. Dedup by root-cause signature. Collapse candidates that share a root-cause signature — the normalized code shape of the bug (e.g. a missing signer check, an unchecked *, a PDA derived without the stored bump), the same signature the re-audit playbook (commands/re-audit.md) uses for its sibling sweep. Two candidates with the same signature at the same root cause are one finding (record all locations); the same signature at different sites are siblings (keep separate, note the shared class).

    • <skill-root> is the directory containing this skill's SKILL.md, never the audited repo. If the bundled tools are built (test -x "<skill-root>/tools/auditor-tools/target/release/audit-mem") and the store passes the OUTPUT-RULES.md Rule 11d check, run again now since a later pull can change the answer (GIT_NO_LAZY_FETCH=1 git --no-pager -c core.fsmonitor=false --icase-pathspecs ls-files -- .audit-memory prints nothing and exits 0, and you created the store; any output, in any letter case, or any error means a fresh --db <path outside the tree> store, which holds no prior rulings), run "<skill-root>/tools/auditor-tools/target/release/audit-mem" check --program-id <id> --signature <sig> per candidate (always this absolute path, never a relative tools/ one): an authoritative FALSE_POSITIVE ruling auto-suppresses the candidate to [N/A — prior ruling #<id>] (record the ruling id in the suppression appendix — never drop it silently). "<skill-root>/tools/auditor-tools/target/release/audit-mem" regressions --program-id <id> flags any finding_id previously FIXED and now re-observed as REGRESSED (deterministic). If the tools are absent, dedup by signature manually and note the tooling gap. (See references/orchestration/pre-scan.md.)
  2. Rule 5b calibration (the gate, applied in batch). Every candidate at N≥6 must carry a filled Reachability + Math/State-Bounds block (plus Attacker-Model for N≥7). A candidate that cannot complete the gate with cited evidence is downgraded — never left as a bare [FAIL-N]:

    • [UNCONFIRMED] — the gate failed on reachability or bounds (unreachable / unbounded as written); reported for manual follow-up, not counted as a confirmed FAIL.
    • [UNDETERMINED] — the path is reachable but its full impact could not be quantified in scope; carried at its likely severity band with "extent not determined within this assessment". Reachable-but-unquantified ≠ unreachable.
    • Cross-check each candidate against references/false-positives.md (FP-1…FP-6 + the fast pass): a candidate matching an entry needs the specific escape cited to file:line, or it is downgraded.
    • Quantify every downgrade. A rejection on "not profitable" / "not exploitable" must show the worked bound — concrete numbers (capital vs. max extractable, cost > gain by how much) or the named blocking precondition @ file:line. A bare "not profitable" / "attacker gains nothing" is not a valid rejection (symmetric to an unquantified High): the finding stays open ([PARTIAL]/[UNCONFIRMED]) until the barrier is computed. Delegate re-derivation of contested N≥8 candidates to peer-reviewer if a judgment call needs an independent read.
  3. Tier split. Partition the survivors into two lists:

    • Security findings (severity 1–10) — real issues with a security impact. These get inline verdicts (Rule 4) and full blocks at N≥4 (Rule 5) / the client report's findings section.
    • Notes & Nitpicks (below severity 1) — observations with no security impact: style, naming, redundant code, micro-optimizations, documentation gaps (OUTPUT-RULES.md Rule 1). A bulleted file:line — observation list, no severity, no remediation-tracking obligation. A note graduates to a severity-1 Informational finding only if it carries a concrete (if minor) security implication — do not inflate nits into findings, and do not bury a real syntactic gap as a nit.
  4. Record occurrences (if tools built). For each surviving finding, "<skill-root>/tools/auditor-tools/target/release/audit-mem" put-finding … records an occurrence for this run so dedup / regression / FP state persists across audits. Skip if the tools are absent.

Output

Emit the triaged set (not a fresh report — this feeds synthesis / the checkpoint):

  • Triaged security findings — deduped, severity-ordered, each carrying its Rule 5b outcome tag.
  • Notes & Nitpicks — the below-severity-1 list.
  • Suppression appendix — everything withheld and why: each [N/A — prior ruling] (with ruling id), each Rule 5b downgrade (with the quantified barrier or named precondition), and each dedup merge (which candidates collapsed into which finding). A reviewer must be able to see exactly what was cut and on what basis — nothing is suppressed silently.

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