<?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>Forem: bigjenkie</title>
    <description>The latest articles on Forem by bigjenkie (@bigjenkie).</description>
    <link>https://forem.com/bigjenkie</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3858567%2Fb5982fc6-60a2-47e9-8011-dc14b36bbd60.png</url>
      <title>Forem: bigjenkie</title>
      <link>https://forem.com/bigjenkie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bigjenkie"/>
    <language>en</language>
    <item>
      <title>How the axios@1.14.1 supply chain attack worked (and how to protect yourself)</title>
      <dc:creator>bigjenkie</dc:creator>
      <pubDate>Fri, 03 Apr 2026 02:23:48 +0000</pubDate>
      <link>https://forem.com/bigjenkie/how-the-axios1141-supply-chain-attack-worked-and-how-to-protect-yourself-jkh</link>
      <guid>https://forem.com/bigjenkie/how-the-axios1141-supply-chain-attack-worked-and-how-to-protect-yourself-jkh</guid>
      <description>&lt;p&gt;On March 31, 2026, someone hijacked the npm account of axios's lead maintainer and published two malicious versions: &lt;code&gt;axios@1.14.1&lt;/code&gt; and &lt;code&gt;axios@0.30.4&lt;/code&gt;. Both contained a hidden dependency called &lt;code&gt;plain-crypto-js&lt;/code&gt; whose postinstall script dropped a cross-platform RAT on every developer machine that ran &lt;code&gt;npm install&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The RAT harvested SSH keys, cloud tokens, AWS credentials, and anything else it could find. It was live on npm for over 12 hours before being pulled. Axios gets 40+ million weekly downloads.&lt;/p&gt;

&lt;p&gt;Here's how the attack worked, what the industry got wrong, and what you can do about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The attack chain
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Account takeover.&lt;/strong&gt; The attacker changed the email on the user's npm account to an attacker-controlled ProtonMail address. npm did not require re-authentication for this change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Pre-staging.&lt;/strong&gt; 18 hours before the main attack, the attacker published &lt;code&gt;plain-crypto-js@4.2.1&lt;/code&gt; — a clean-looking package with no obvious malicious code. This gave it time to build a benign-looking publish history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Payload delivery.&lt;/strong&gt; The attacker published &lt;code&gt;axios@1.14.1&lt;/code&gt; (latest tag) and &lt;code&gt;axios@0.30.4&lt;/code&gt; (legacy tag) within 39 minutes of each other. Both added &lt;code&gt;plain-crypto-js&lt;/code&gt; as a dependency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Execution.&lt;/strong&gt; When a developer ran &lt;code&gt;npm install&lt;/code&gt;, npm resolved the new axios version, pulled in &lt;code&gt;plain-crypto-js&lt;/code&gt;, and ran its postinstall script. That script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detected the OS (macOS, Windows, or Linux)&lt;/li&gt;
&lt;li&gt;Downloaded a platform-specific RAT binary&lt;/li&gt;
&lt;li&gt;Established a C2 connection&lt;/li&gt;
&lt;li&gt;Began harvesting credentials&lt;/li&gt;
&lt;li&gt;Cleaned up after itself by rewriting its own package.json&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole thing took less than 2 seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why existing tools missed it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;npm audit&lt;/strong&gt; only checks against known CVEs. A brand-new malicious package has no CVE yet. npm audit said nothing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dependabot&lt;/strong&gt; is reactive — it alerts after the advisory is published, not before. The advisory came 12+ hours after the malicious version was live.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Snyk&lt;/strong&gt; relies on its vulnerability database. Same problem — the database lags behind the attack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Socket.dev&lt;/strong&gt; was the fastest to detect it (behavioral analysis flagged the new dependency and install script), but even Socket took hours to publish an alert.&lt;/p&gt;

&lt;p&gt;The gap between "malicious package published" and "advisory issued" was 12+ hours. That's 12 hours where every &lt;code&gt;npm install&lt;/code&gt; of axios pulled down a RAT.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually protects you
&lt;/h2&gt;

&lt;p&gt;The common advice is "pin your dependencies" and "use lockfiles." That helps with automated installs, but it doesn't help when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A developer manually runs &lt;code&gt;npm install axios@latest&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;An AI coding assistant runs &lt;code&gt;npm install&lt;/code&gt; on your behalf&lt;/li&gt;
&lt;li&gt;You're starting a new project and installing fresh&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What you actually need is a check that runs before install scripts execute. Something that looks at the package and says "this is suspicious" before it's too late.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we built
&lt;/h2&gt;

&lt;p&gt;After seeing the axios warning on r/ClaudeAI, we built &lt;a href="https://github.com/Vanguard-Defense-Solutions/ward" rel="noopener noreferrer"&gt;Ward&lt;/a&gt; — an open-source tool that hooks into your package manager and checks every package before install scripts run.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;axios@1.14.1
&lt;span class="go"&gt;✗ ward: BLOCKED
  This version steals SSH keys and cloud credentials
  Safe version: 1.14.0
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It checks four things locally in under 200ms:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Known threat database.&lt;/strong&gt; Ward ships with 42 verified real-world attacks (axios, event-stream, ua-parser-js, colors/faker, the Solana web3.js compromise, the Shai-Hulud worm, and more). The database syncs daily from GitHub Advisories and community submissions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Typosquat detection.&lt;/strong&gt; If you try to install &lt;code&gt;axxios&lt;/code&gt; instead of &lt;code&gt;axios&lt;/code&gt;, Ward warns you. It uses Levenshtein distance against the top 500 npm packages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Install script analysis.&lt;/strong&gt; Ward flags packages with unknown preinstall/postinstall scripts. Known-safe patterns like &lt;code&gt;node-gyp rebuild&lt;/code&gt; are allowed through.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Version anomaly detection.&lt;/strong&gt; Unexpected major version jumps (1.x to 4.x) and non-existent versions get flagged.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup takes 30 seconds
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; wardshield
ward init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Ward hooks into npm (and bun and yarn) transparently. You don't change your workflow — you just have protection.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you use AI coding assistants
&lt;/h2&gt;

&lt;p&gt;Ward was built specifically for the AI-assisted development workflow. When Claude Code, Cursor, or Copilot runs &lt;code&gt;npm install&lt;/code&gt; on your behalf, Ward screens it. There's a Claude Code hook that intercepts every install command before it executes.&lt;/p&gt;

&lt;p&gt;This matters because AI tools install packages without you reviewing every one. The attack surface is larger when an agent is making decisions about your dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  The threat feed
&lt;/h2&gt;

&lt;p&gt;We maintain a public threat feed at &lt;a href="https://wardshield.com" rel="noopener noreferrer"&gt;wardshield.com&lt;/a&gt; with every verified supply chain attack we track. There's also a JSON API at &lt;a href="https://api.wardshield.com/threats" rel="noopener noreferrer"&gt;api.wardshield.com/threats&lt;/a&gt; if you want to build on top of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's free and open source
&lt;/h2&gt;

&lt;p&gt;Ward is MIT licensed. The full local engine is free, unlimited, forever. No account needed, no cloud required. The source is at &lt;a href="https://github.com/Vanguard-Defense-Solutions/ward" rel="noopener noreferrer"&gt;github.com/Vanguard-Defense-Solutions/ward&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Built by &lt;a href="https://vanguarddefensesolutions.com" rel="noopener noreferrer"&gt;Vanguard Defense Solutions&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;The axios attack was not sophisticated. It was an account takeover followed by a dependency injection. The same attack pattern has been used successfully against event-stream (2018), ua-parser-js (2021), colors/faker (2022), @solana/web3.js (2024), and dozens more.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>opensource</category>
      <category>security</category>
      <category>npm</category>
    </item>
  </channel>
</rss>
