Ayomide Odewale
Ayomide Odewale
|
August 18, 2026
|
7 min read
|
11 views

NPM Attacks: what actually happened (video companion + sources)

Companion notes for the NPM Attacks video. Full detail on React2Shell, the TanStack compromise, the Nx Console to GitHub breach, and the AI code security data, with every source linked.

NPM Attacks: what actually happened

Companion notes for the video. Every figure quoted on screen is listed here with the source it came from, so you can check the work yourself. Nothing below is reconstructed from memory; each claim traces to a vendor report, an official statement, or a peer-reviewed paper.


Timeline at a glance

Date Event
Dec 3, 2025 React discloses CVE-2025-55182, "React2Shell". CVSS 10.0.
Dec 5, 2025 CISA adds it to the Known Exploited Vulnerabilities catalog.
May 11, 2026 42 TanStack packages published from a hijacked release pipeline, 19:20 to 19:26 UTC.
May 13, 2026 OpenAI publishes its incident report.
May 18, 2026 A poisoned Nx Console build goes live on the VS Code Marketplace. Live for 18 minutes.
May 20, 2026 GitHub confirms roughly 3,800 internal repositories were exfiltrated.

Incident 1: React2Shell (CVE-2025-55182)

React's first critical remote code execution vulnerability, and it scored a perfect 10.0 on CVSS.

The flaw sat in how React Server Components decode payloads sent to Server Function endpoints, an insecure deserialisation issue in the Flight protocol. Affected versions run from React 19.0 through 19.2.0.

What made it severe was the absence of preconditions. No authentication. No unusual configuration. No user interaction. A single crafted HTTP request to an app exposing React Server Functions was enough to execute arbitrary code in the server process.

It was reported by Lachlan Davidson on November 29, disclosed publicly on December 3, and added to the US government's Known Exploited Vulnerabilities catalog on December 5 after confirmed exploitation in the wild.

Worth noting for accuracy: the catalog is the Known Exploited Vulnerabilities catalog. Being listed means active exploitation has been observed, not that a flaw is theoretical.


Incident 2: TanStack (CVE-2026-45321)

This is the one that matters most, because nothing about it was forged.

On May 11, 2026, between 19:20 and 19:26 UTC, 42 TanStack packages were published to npm carrying 84 malicious versions. @tanstack/react-router alone pulls around 12.7 million downloads a week. An outside researcher flagged it roughly 20 minutes after the first publish.

The attackers did not steal a password or crack a signing key. The chain ran like this:

  1. Pwn request. A fork opened a pull request that triggered a pull_request_target workflow, which meant attacker-controlled code executed inside the trusted workflow context.
  2. Cache poisoning. That run wrote a malicious pnpm store into the GitHub Actions cache, crossing the fork and base boundary that most teams assume is a wall.
  3. Token theft. The release job restored the poisoned cache, and the OIDC token was read out of the runner's process memory.

The result: npm publish executed from TanStack's own pipeline, with valid provenance attached. The registry showed the packages as built and signed by tanstack/router. Every supply chain check we tell developers to run would have passed.

This is believed to be the first documented npm compromise to ship malware carrying valid SLSA provenance. The attestation was accurate. It attested to a build that had already been subverted.

The campaign, tracked as Mini Shai-Hulud, spread past TanStack. More than 170 packages across npm and PyPI were affected in the same wave, including Mistral AI and 66 UiPath package versions.

Who it reached

OpenAI published an incident report on May 13. Two employee devices in its corporate environment were compromised, with credential-focused exfiltration from a limited subset of internal source code repositories. Those repositories held product signing certificates, so signing keys for iOS, macOS, Windows and Android were rotated as a precaution. OpenAI stated no user data and no product was compromised. The blast radius was the toolchain itself.


Incident 3: Nx Console to GitHub

About a week later, the same threat actor moved sideways.

On May 18 a poisoned build of the Nx Console extension went live on the VS Code Marketplace. It was pulled 18 minutes later. That was enough. The payload was a credential stealer reaching for 1Password vaults, Claude Code configuration files, npm tokens, GitHub tokens and AWS credentials.

A GitHub employee installed it. On May 20, GitHub confirmed that roughly 3,800 internal repositories had been exfiltrated. The data was subsequently listed for sale on a criminal forum starting around $50,000, attributed to a group calling itself TeamPCP, tracked by incident responders as UNC6780.

One developer endpoint, 18 minutes of exposure, and the internal codebase of the platform that hosts most of the world's open source.


The part that gets less attention: AI coding tools

All of this happened while AI assistants took over a growing share of code authorship. Two datasets are worth knowing.

Security did not improve with model size

Veracode has tested over 100 models against 80 real coding tasks across four snapshots since 2023. The syntax pass rate climbed from around 50 percent to roughly 100 percent. Models write code that compiles and runs.

The security pass rate has not moved. It sits at 56 percent, essentially flat across every snapshot. Around 44 to 45 percent of completed tasks introduced a detectable vulnerability. Larger and newer models did not close the gap. Veracode's framing is blunt and correct: syntax is solved, security is not.

Slopsquatting

Researchers tested 16 code generating models across 576,000 generated samples. On average, 19.7 percent of recommended packages did not exist. That produced 205,474 unique hallucinated package names.

The critical detail is repeatability. Around 43 percent of hallucinated names recurred on every re-run of the same prompt. A hallucination that repeats is not noise, it is a predictable target. An attacker runs the prompts, collects the names that keep coming back, registers them on npm, and publishes malware under names that models are already primed to recommend with full confidence.

The victim never makes a mistake. They install what their assistant told them to install.


What actually helps

  • Pin your trusted publisher. Lock OIDC publishing to one repository, one workflow and one branch, so a compromised job in a different context cannot mint a publishing token.
  • Add an install delay. minimumReleaseAge keeps you off versions that are only minutes old. In both the TanStack and Nx cases, the malicious window was under half an hour.
  • Audit pull_request_target usage. Treat any workflow that runs fork code with repository secrets or cache write access as a publishing surface.
  • Commit and audit lockfiles. CI should install what you reviewed, not whatever is newest at build time.
  • Verify every AI-suggested package before installing. Confirm it exists, has download history, and has a real repository behind it.
  • Treat a compromised install as a breach. Rotate every credential reachable from that host, not just the one you think was taken.

Provenance and signing still matter. They just answer a narrower question than most teams assume. A valid attestation tells you where a package was built. It does not tell you that the build was trustworthy.


Sources

React2Shell

TanStack and Mini Shai-Hulud

Nx Console and the GitHub breach

AI code security and slopsquatting


Screenshots shown in the video were captured from the live pages above on August 17, 2026.

Published with Braandly