<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cody Pack</title>
    <description>The latest articles on DEV Community by Cody Pack (@cody_pack_1175f5b6566117c).</description>
    <link>https://dev.to/cody_pack_1175f5b6566117c</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4183404%2F5e1f574e-8fa0-4e9b-8dd7-1707096468b5.png</url>
      <title>DEV Community: Cody Pack</title>
      <link>https://dev.to/cody_pack_1175f5b6566117c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cody_pack_1175f5b6566117c"/>
    <language>en</language>
    <item>
      <title>I built a free static analyzer for Solana programs — here's what it catches and how it's built</title>
      <dc:creator>Cody Pack</dc:creator>
      <pubDate>Wed, 14 Oct 2026 02:26:30 +0000</pubDate>
      <link>https://dev.to/cody_pack_1175f5b6566117c/i-built-a-free-static-analyzer-for-solana-programs-heres-what-it-catches-and-how-its-built-3n54</link>
      <guid>https://dev.to/cody_pack_1175f5b6566117c/i-built-a-free-static-analyzer-for-solana-programs-heres-what-it-catches-and-how-its-built-3n54</guid>
      <description>&lt;p&gt;Solana exploits keep hitting the same bug classes: missing signer checks, arbitrary cross-program invocations, unchecked account deserialization, integer overflow. These aren't exotic — they're the same patterns that have drained hundreds of millions of dollars from on-chain programs, and they're detectable with static analysis before code ever gets deployed.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;SolAudit&lt;/strong&gt;: a free, MIT-licensed static analyzer for Anchor/Solana Rust programs. 0.2.0 shipped this week.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it in 10 seconds:&lt;/strong&gt; &lt;code&gt;npx solaudit ./your-program&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Point SolAudit at a directory of &lt;code&gt;.rs&lt;/code&gt; files and it applies 11 security rules, then gives you a report grouped by severity — no RPC calls, no wallet, no build step:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Severity&lt;/th&gt;
&lt;th&gt;Examples&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CRITICAL&lt;/td&gt;
&lt;td&gt;Missing signer checks on token transfers/mints&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HIGH&lt;/td&gt;
&lt;td&gt;Arbitrary CPI (caller-controlled program IDs), unchecked deserialization, type cosplay, insecure manual account closure, missing bump canonicalization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MEDIUM&lt;/td&gt;
&lt;td&gt;Integer overflow on balance math, insecure account init, missing rent-exemption checks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LOW&lt;/td&gt;
&lt;td&gt;Missing owner checks&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each finding includes the exact line and a concrete remediation hint. Exit code is &lt;code&gt;1&lt;/code&gt; on any CRITICAL/HIGH finding, so it drops straight into CI as a gate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three ways to use it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt; — &lt;code&gt;npx solaudit ./program&lt;/code&gt;, or &lt;code&gt;bun add -g solaudit&lt;/code&gt;. Outputs human-readable, &lt;code&gt;--json&lt;/code&gt;, or &lt;code&gt;--sarif&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Web app&lt;/strong&gt; — &lt;a href="https://solaudit-web.vercel.app/" rel="noopener noreferrer"&gt;solaudit-web.vercel.app&lt;/a&gt;. Paste a public GitHub repo URL or upload a single &lt;code&gt;.rs&lt;/code&gt; file. No install.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Action&lt;/strong&gt; — on the &lt;a href="https://github.com/marketplace/actions/solaudit-security-scanner" rel="noopener noreferrer"&gt;Marketplace&lt;/a&gt;. Ten lines of YAML and every push gets scanned, with findings uploaded to your repo's Security tab as code-scanning alerts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;blueeyez425-art/solaudit@main&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./programs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  On accuracy — honest numbers
&lt;/h2&gt;

&lt;p&gt;On the committed labeled benchmark suite, the engine scores &lt;strong&gt;93.8% precision, 100% recall, 96.8% F1&lt;/strong&gt; on rule-covered categories.&lt;/p&gt;

&lt;p&gt;Those numbers describe that suite, not general effectiveness. One known gap remains: &lt;strong&gt;duplicate mutable accounts&lt;/strong&gt;. I built a "distinctness" heuristic for it, it produced false positives on common legitimate patterns (e.g., a deposit instruction's user/vault token accounts of the same type), so I didn't ship it. A scanner that cries wolf gets uninstalled; I'd rather have a smaller rule set people trust.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supply chain: verify the build yourself
&lt;/h2&gt;

&lt;p&gt;A security tool that asks you to trust its binaries shouldn't exist. Every npm publish of SolAudit goes through GitHub Actions &lt;strong&gt;trusted publishing&lt;/strong&gt; with signed &lt;a href="https://www.npmjs.com/package/solaudit#provenance" rel="noopener noreferrer"&gt;Sigstore provenance&lt;/a&gt; — the package on npm is cryptographically bound to an exact commit and workflow run in the public repo. There's no "someone's laptop" in the loop. npm displays the provenance badge on the package page.&lt;/p&gt;

&lt;h2&gt;
  
  
  The dogfooding story
&lt;/h2&gt;

&lt;p&gt;The repo's own CI runs SolAudit against its intentionally vulnerable example program on every push. Setting that up immediately caught a real bug — in my own Action: when a consuming repo had a local workspace package named &lt;code&gt;solaudit&lt;/code&gt;, &lt;code&gt;npx&lt;/code&gt; would resolve the &lt;em&gt;local&lt;/em&gt; package instead of the pinned npm release, and the scan silently ran... nothing. The fix: install the pinned CLI into a temp dir and invoke it directly. Self-scanning found a distribution bug before any user did. That's the loop working as advertised.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Closing the duplicate-mutable-accounts gap with a smarter heuristic that survives the false-positive review&lt;/li&gt;
&lt;li&gt;More rules from post-mortems of real exploits&lt;/li&gt;
&lt;li&gt;Reentrancy-via-CPI-callback detection&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/blueeyez425-art/solaudit" rel="noopener noreferrer"&gt;https://github.com/blueeyez425-art/solaudit&lt;/a&gt; (⭐ if useful)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/solaudit" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/solaudit&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Action:&lt;/strong&gt; &lt;a href="https://github.com/marketplace/actions/solaudit-security-scanner" rel="noopener noreferrer"&gt;https://github.com/marketplace/actions/solaudit-security-scanner&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Demo:&lt;/strong&gt; &lt;a href="https://solaudit-web.vercel.app/" rel="noopener noreferrer"&gt;https://solaudit-web.vercel.app/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback, false positives, and rule requests are all welcome as GitHub issues. SolAudit is free and will keep being built either way — development doesn't depend on tips. That said, if it saved you real time or caught a real bug, there's a tip link in the README, and it's genuinely appreciated.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built by an independent security researcher. SolAudit is a first-pass scanner, not an audit — it doesn't replace manual review for anything holding real funds.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solana</category>
      <category>security</category>
      <category>rust</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
