<?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: LuzAramburo</title>
    <description>The latest articles on DEV Community by LuzAramburo (@luzaramburo).</description>
    <link>https://dev.to/luzaramburo</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%2F2012768%2F14423414-8bc0-4ffb-bf86-ac9d29ebccce.jpeg</url>
      <title>DEV Community: LuzAramburo</title>
      <link>https://dev.to/luzaramburo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luzaramburo"/>
    <language>en</language>
    <item>
      <title>Supply Chain Attacks Aren't Just a Big Library Problem — Here's What You Can Do Today</title>
      <dc:creator>LuzAramburo</dc:creator>
      <pubDate>Mon, 18 May 2026 22:38:09 +0000</pubDate>
      <link>https://dev.to/luzaramburo/supply-chain-attacks-arent-just-a-big-library-problem-heres-what-you-can-do-today-1jbg</link>
      <guid>https://dev.to/luzaramburo/supply-chain-attacks-arent-just-a-big-library-problem-heres-what-you-can-do-today-1jbg</guid>
      <description>&lt;p&gt;In May 2026, a worm called Shai-Hulud compromised 42 TanStack packages — including &lt;code&gt;@tanstack/react-router&lt;/code&gt;, a library sitting in millions of JavaScript projects. It was live for about 3 hours. That was enough. If you installed dependencies that day, you may have been affected without knowing it. This post isn't for the people who maintain those libraries. It's for the rest of us — the developers who just use them.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Fun fact" 1&lt;/strong&gt;&lt;br&gt;
It was live ~3 hours. &lt;code&gt;@tanstack/react-router&lt;/code&gt; alone gets &lt;strong&gt;12.7 million weekly downloads&lt;/strong&gt;. Meaning that it had &lt;strong&gt;~225K downloads in the ~3 hour window&lt;/strong&gt; — just for &lt;code&gt;react-router&lt;/code&gt;. That's one package. The attack hit 42 &lt;code&gt;@tanstack/*&lt;/code&gt; packages total.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Supply chain attacks used to feel like someone else's problem. A big library gets compromised, the maintainers fix it, life goes on. The Shai-Hulud worm changed that framing. It spread automatically to every package its victims maintained, turning regular developers into unwilling distributors of malware. Here's what happened, and what you can do today to reduce your exposure.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The workflow used &lt;code&gt;pull_request_target&lt;/code&gt;&lt;/strong&gt;, which runs with the base repo's trusted permissions — including access to secrets and a build cache shared with the real release pipeline.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;But it also checked out and executed the fork's code&lt;/strong&gt; for benchmarking purposes. That's the dangerous mix: a stranger's code running with your own repo's trust.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The attacker didn't need to steal anything immediately.&lt;/strong&gt; They just poisoned the shared cache and waited. Hours later, the legitimate release pipeline ran, picked up the tampered cache without knowing it, and published the malicious packages itself — using TanStack's own valid credentials.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The key insight&lt;/strong&gt;: the misconfiguration wasn't obvious. The benchmarking intent was reasonable; the mistake was not realizing that &lt;code&gt;pull_request_target&lt;/code&gt; + "run the PR's code" is always a dangerous combination regardless of what you're trying to do with it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Fun fact" 2&lt;/strong&gt;&lt;br&gt;
The worm had a &lt;strong&gt;dead-man's switch&lt;/strong&gt;. It planted a background service that polled &lt;code&gt;api.github.com/user&lt;/code&gt; with the stolen GitHub token every 60 seconds. If the token was revoked — meaning GitHub returned a 40x response — the service triggered &lt;code&gt;rm -rf ~/&lt;/code&gt;, wiping the user's entire home directory. You had to disable and remove the monitor service &lt;strong&gt;before&lt;/strong&gt; revoking any credentials&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The good news
&lt;/h3&gt;

&lt;p&gt;Th &lt;code&gt;pull_request_target&lt;/code&gt; Pwn Request specifically requires a public repo where strangers can open PRs.&lt;/p&gt;

&lt;h3&gt;
  
  
  The bad news
&lt;/h3&gt;

&lt;p&gt;That said, the &lt;em&gt;other&lt;/em&gt; parts of this attack (cache poisoning between workflows, OIDC token over-scoping) can still apply to private repos if your GitHub Actions workflows have similar misconfigurations&lt;/p&gt;

&lt;p&gt;So far this sounds like a problem for library maintainers. It isn't. You don't need to maintain a library with millions of downloads to be exposed. You just need to run &lt;code&gt;npm install&lt;/code&gt; on the wrong day at the wrong time. The moment a compromised package lands in your &lt;code&gt;node_modules&lt;/code&gt;, you're part of the chain too.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to prevent similar incidents?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  min-release-age &amp;amp; ignore-scripts
&lt;/h3&gt;

&lt;h4&gt;
  
  
  NPM — &lt;code&gt;.npmrc&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="py"&gt;min-release-age&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;7&lt;/span&gt;
&lt;span class="py"&gt;ignore-scripts&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;min-release-age=7&lt;/code&gt; blocks packages published less than 7 days ago&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ignore-scripts=true&lt;/code&gt; prevents lifecycle scripts like &lt;code&gt;preinstall&lt;/code&gt;/&lt;code&gt;prepare&lt;/code&gt; from running on install — which is exactly the vector the malicious &lt;code&gt;optionalDependency&lt;/code&gt; used.&lt;/li&gt;
&lt;li&gt;⚠️ npm CLI v11 is required. Upgrade to Node 24, or manually install npm v11.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  pnpm (10.16) — &lt;code&gt;pnpm-workspace.yaml&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;minimumReleaseAge&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10080&lt;/span&gt;  &lt;span class="c1"&gt;# minutes — 7 days&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;minimumReleaseAge&lt;/code&gt; is on by default, it uses 1 day&lt;/li&gt;
&lt;li&gt;Requires version 10.16 to avoid a bug that ignored this config.&lt;/li&gt;
&lt;li&gt;ignore-scripts: pnpm v10 stopped running &lt;code&gt;preinstall&lt;/code&gt;/&lt;code&gt;postinstall&lt;/code&gt; scripts by default&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Yarn Classic
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;❌ &lt;code&gt;min-release-age&lt;/code&gt; — &lt;strong&gt;not available.&lt;/strong&gt; No equivalent exists in v1.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;yarn install --ignore-scripts&lt;/code&gt; exists but only as a CLI argument&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Yarn Berry (v2+) — &lt;code&gt;.yarnrc.yml&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;npmMinimalAgeGate&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10080&lt;/span&gt;   &lt;span class="c1"&gt;# minutes — 7 days&lt;/span&gt;
&lt;span class="na"&gt;enableScripts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;        &lt;span class="c1"&gt;# ignore-scripts equivalent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;⚠️ Requires Yarn 4.10 and applies globally with no way to scope it&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Dockerfile
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; npm_config_min_release_age=3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;npm ci&lt;/code&gt; does respect &lt;code&gt;.npmrc&lt;/code&gt; settings and environment variables — the &lt;code&gt;npm_config_*&lt;/code&gt; convention works for both &lt;code&gt;install&lt;/code&gt; and &lt;code&gt;ci&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;⚠️ Still requires node v24 or npm v11, otherwhise &lt;code&gt;ENV npm_config_min_release_age=3&lt;/code&gt; in your Dockerfile will be &lt;strong&gt;silently ignored&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Option A — Upgrade to Node 24 in Docker only&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; node:24-alpine&lt;/span&gt;
&lt;span class="c"&gt;# npm v11 is included, min-release-age works&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; npm_config_min_release_age=3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Option B — Stay on your Node version, manually install npm v11&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; node:22-alpine&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; npm@11
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; npm_config_min_release_age=3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://snyk.io/blog/tanstack-npm-packages-compromised" rel="noopener noreferrer"&gt;https://snyk.io/blog/tanstack-npm-packages-compromised&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tanstack.com/blog/npm-supply-chain-compromise-postmortem" rel="noopener noreferrer"&gt;https://tanstack.com/blog/npm-supply-chain-compromise-postmortem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TanStack commit histor&lt;/strong&gt;y &lt;a href="https://github.com/TanStack/router/commit/3ee179f0d9972173cb7510773fd26cb391b5fef5#diff-749feccfd42652f4a7571f0103a5b5b516b2b6d40f64f64200ac4c64870342aa" rel="noopener noreferrer"&gt;https://github.com/TanStack/router/commit/3ee179f0d9972173cb7510773fd26cb391b5fef5#diff-749feccfd42652f4a7571f0103a5b5b516b2b6d40f64f64200ac4c64870342aa&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm &lt;code&gt;min-release-age&lt;/code&gt;&lt;/strong&gt; &lt;a href="https://docs.npmjs.com/cli/v11/using-npm/config#min-release-age" rel="noopener noreferrer"&gt;https://docs.npmjs.com/cli/v11/using-npm/config#min-release-age&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm + Node version relationship&lt;/strong&gt; (confirms v11 ships with Node 24) &lt;a href="https://nodejs.org/en/download/releases" rel="noopener noreferrer"&gt;https://nodejs.org/en/download/releases&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pnpm &lt;code&gt;minimumReleaseAge&lt;/code&gt;&lt;/strong&gt; &lt;a href="https://pnpm.io/settings#minimumreleaseage" rel="noopener noreferrer"&gt;https://pnpm.io/settings#minimumreleaseage&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pnpm v11 release notes&lt;/strong&gt; (confirms it's on by default at 1 day) &lt;a href="https://pnpm.io/blog/releases/11.0" rel="noopener noreferrer"&gt;https://pnpm.io/blog/releases/11.0&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Yarn Berry &lt;code&gt;npmMinimalAgeGate&lt;/code&gt;&lt;/strong&gt; (introduced in 4.10) &lt;a href="https://yarnpkg.com/configuration/yarnrc#npmMinimalAgeGate" rel="noopener noreferrer"&gt;https://yarnpkg.com/configuration/yarnrc#npmMinimalAgeGate&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Yarn Berry &lt;code&gt;enableScripts&lt;/code&gt;&lt;/strong&gt; &lt;a href="https://yarnpkg.com/configuration/yarnrc#enableScripts" rel="noopener noreferrer"&gt;https://yarnpkg.com/configuration/yarnrc#enableScripts&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cover Image&lt;/strong&gt;: &lt;a href="https://unsplash.com/photos/man-in-black-jacket-sitting-on-brown-rock-during-daytime-vIHwLieg-wo" rel="noopener noreferrer"&gt;https://unsplash.com/photos/man-in-black-jacket-sitting-on-brown-rock-during-daytime-vIHwLieg-wo&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>cybersecurity</category>
      <category>npm</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
