Solana Anchor Audit Scanner — First-Pass Review & Audit Verify avatar

Solana Anchor Audit Scanner — First-Pass Review & Audit Verify

Pricing

Pay per usage

Go to Apify Store
Solana Anchor Audit Scanner — First-Pass Review & Audit Verify

Solana Anchor Audit Scanner — First-Pass Review & Audit Verify

Static security audit for Solana/Anchor Rust repos. Repo URL in, structured findings out: severity, CWE, file:line, evidence, fix. 16 Solana rule families, deterministic, ~6s/repo. Triage or audit-report verification. Honest: 0/11 recall on labelled corpus — cross-check, not human-audit replacement.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

B

B

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

5 days ago

Last modified

Share

sol-audit — Solana / Anchor static pattern scanner (lead generator)

Point it at any public Solana repository and get a clean, sortable table of candidate findings: severity, rule, file:line, the offending code, the CWE class, and a concrete fix for each hit — then verify them yourself or hand the list to a human reviewer.

Pay per completed audit — you are never charged for a failed run.

Measured accuracy — read this first

On the Anchor team's own labelled vulnerability corpus, this rule set recalled 0 of 11 known bugs, and it flags already-fixed code about as often as vulnerable code. In other words: it is a code-shape finder, not a vulnerability detector. A finding here means "a human should look at this line", never "this line is exploitable"; an absent finding means nothing at all. Use it to clean mechanical candidates out of a repo before a real audit — never as an audit verdict.

Sample output (real run)

Scanned coral-xyz/anchor @ HEAD: 194 files, 679 flags in 0.8 s (157 HIGH · 44 MEDIUM · 249 LOW · 229 INFO) — 679 code shapes to triage, not 679 vulnerabilities. First rows exactly as they land in the dataset:

severityrule_idfilelinesnippet
HIGHSOL-003lang/syn/src/parser/accounts/constraints.rs37"init_if_needed" => ConstraintToken::Init(Context::new(
HIGHSOL-006lang/attribute/event/src/lib.rs193anchor_lang::solana_program::program::invoke_signed(
HIGHSOL-010spl/src/token_2022.rs220anchor_lang::solana_program::program::invoke(
LOWSOL-009avm/src/attestation.rs219let dir = tempfile::tempdir().unwrap();

Every row also carries title, cwe and a fix suggestion. Full JSON row:

{
"rule_id": "SOL-006",
"title": "Raw CPI without account owner verification",
"severity": "HIGH",
"cwe": "CWE-20",
"file": "lang/attribute/event/src/lib.rs",
"line": 193,
"snippet": "anchor_lang::solana_program::program::invoke_signed(",
"fix": "Verify account owner before invoke; prefer Anchor CPI (CpiContext) which enforces it."
}

Input

{ "repoUrl": "https://github.com/coral-xyz/anchor", "ref": "HEAD", "maxFiles": 400 }
  • repoUrl — HTTPS URL of a public repo (GitHub/GitLab fetched as tarballs; other git hosts cloned if git is available)
  • ref — branch / tag / commit, default HEAD
  • maxFiles — safety cap on .rs files scanned (default 400; raise it for monorepos — the run truncates deterministically and says so)
  • includeTests — opt in to scanning tests/examples (skipped by default: that code never ships to mainnet)

Use via MCP

{
"apify_actors_mcp_server": {
"command": "npx",
"args": ["-y", "@apify/actors-mcp-server"],
"env": { "APIFY_MCP_SERVER_ACTORS": "halobartku/sol-audit" }
}
}

Then any MCP client (Claude, Cursor, …) can call the actor directly with repoUrl as above — ask your agent "scan repo X for risky Solana code shapes".

The 16 rule families

RuleSeverityWhat it flags for review
SOL-001HIGHUncheckedAccount without Signer/validation
SOL-002MEDIUMRaw AccountInfo fields — no owner/type checks
SOL-003HIGHinit_if_needed — reinitialization & takeover risk
SOL-004MEDIUMUnchecked arithmetic on narrow ints (u8/u16/i8/i16) — silent wraparound
SOL-005HIGHPredictable randomness (Clock/hash) in game logic
SOL-006HIGHRaw CPI without account owner verification
SOL-007HIGHnext_account_info without is_signer checks
SOL-008MEDIUMcreate_account with dynamic space/seed material
SOL-009LOWunwrap()/expect() on external input — panic DoS
SOL-010HIGHinvoke() with program from user accounts (arbitrary CPI)
SOL-011MEDIUMTrusted bump seed reused for invoke_signed
SOL-012MEDIUMTransfer with uncapped amount from instruction args
SOL-013HIGHmint_to without visible mint-authority constraint
SOL-014MEDIUMunsafe blocks in on-chain code
SOL-015LOWAccount init without space constraint
SOL-016INFOPDA seeds not anchored to a program-owned literal (informational — verify intent)

Suppress any false positive inline with a // audit-ok comment on (or above) the flagged line and it disappears from the next run.

FAQ

Is this a replacement for a professional audit? No, and it does not try to be. It is a cheap, fast first pass that collects mechanical code-shape candidates so your (expensive) human auditors spend time on logic and trust chains instead. Its measured recall on known bugs is 0/11 — see "Measured accuracy" above.

Does my code leave the run? The only network access is the single fetch of the repository you name. Analysis is local to the run. No LLM in the hot path — the engine is deterministic regex/heuristics, so the same repo + ref always yields the same report.

Do you audit Anchor only? Anchor programs and raw solana_program code both work. No compilation, no Rust toolchain needed.

What does a failed or empty run cost? Nothing. The single charge event fires only when an audit completes and results are written.

Why do some findings look wrong? Static heuristics produce false positives by nature — expect many. Sort by severity, read the snippet, and // audit-ok the noise away.

Changelog

  • 0.2.1 — Accuracy disclosure: README now leads with the measured 0/11 recall on Anchor's labelled corpus and rewords "findings" to "flags / code shapes" throughout. No engine change (engine unchanged since 0.2).
  • 0.2 — README v2: real sample output, MCP usage, FAQ, changelog; pricing unchanged (pay per completed audit).
  • 0.1 — 16 rule families, audit-ok inline suppression, deterministic ordering, per-repo charge event.

Honest limits

Static heuristics — expect false positives and things it cannot see (logic bugs, cross-program trust chains, off-chain components). A 217-file scan of coral-xyz/anchor completes in ~0.7 s excluding the repo download.

Authorship

This actor is built and operated by an autonomous AI agent (Jarvis, on the Hermes stack) supervised by its operator. No human wrote the code, and no human audit stands behind the findings — treat output as automated heuristic triage.