惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
I
InfoQ
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
有赞技术团队
有赞技术团队
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
博客园_首页
Y
Y Combinator Blog
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
雷峰网
雷峰网
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
H
Help Net Security
P
Proofpoint News Feed
B
Blog
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Deep Dive: TanStack npm supply-chain compromise
Shruti Kapoo · 2026-05-16 · via DEV Community

This post is part of my weekly newsletter - Top 5 in Frontend and AI. Subscribe so you can deep dives like this in your inbox


If you have pull_request_target anywhere in your workflows, the TanStack compromise could happen to you. Here's exactly how it happened.

On May 11, a new strain of Shai-Hulud worm published 84 malicious versions across 42 @tanstack/* packages by chaining three GitHub Actions vulnerabilities - pull_request_target Pwn (Own) Request, cache poisoning across the fork ↔ base trust boundary, and OIDC token extraction from runner memory. Thankfully, no maintainer was phished and no token was stolen off a laptop.

What happened

An attacker opened a PR from a throwaway fork of TanStack/router . Although the maintainers never got a chance to review the PR since it was immediately closed, the CI workflow was triggered. The damage was already done because the bundle-size.yml workflow ran on pull_request_target, which runs in the base repo's privileged context with no first-time-contributor approval gate in the TanStack repo.

That workflow checked out the fork's PR-merge ref and ran pnpm nx run @benchmarks/bundle-size:build, which executed attacker-controlled code.

The attacker's code poisoned the pnpm cache and later, when an entirely legitimate merge to main, from a different PR, ran the release workflow, it restored that poisoned cache, extracted the short-lived publish token out of the runner's memory, and used it to push malicious versions across router-family packages.

The attacker managed to engineer a path where their own CI pipeline stole its own publish token for them, at the exact moment it was created, by way of a cache that everyone in the chain implicitly trusted.

What the malware does

When anyone runs npm install , pnpm install or yarn install against any affected version, npm resolves the optionalDepedencies array where the attacker added a pointer to a specific commit in a GitHub fork which contains the malicious package entry and executes a router_init.js . The script does the following things -

  1. Steals every credential it can find: It walks through all the usual places developer machines and CI runners keep secrets. Your ~/.npmrc, your GitHub tokens (env vars, gh CLI config, .git-credentials), your SSH private keys, your cloud runners.
  2. Smuggles the stolen secrets out using Session messenger: Session is an encrypted messaging app, and the malware uses its file-upload servers as a dead drop. The traffic looks like normal Session traffic, and the contents are end-to-end encrypted so even your network monitoring can't see what's being exfiltrated. The only way to stop it at the network level is to block the Session domains outright.
  3. Tries to spread: That's the worm part of the attack. One compromised maintainer becomes the next set of compromised packages, which compromises the next set of maintainers, and so on.

Who was affected

42 packages, 84 versions, published in two waves roughly 6 minutes apart between 19:20 and 19:26 UTC on 2026-05-11. Confirmed clean families include @tanstack/query*, @tanstack/table*, @tanstack/form*, @tanstack/virtual*, @tanstack/store, and the @tanstack/start meta-package (but not @tanstack/start-*). Anyone who installed an affected version on 2026-05-11 must treat the install host as potentially compromised.

What should you do

  1. Check your lockfiles for @tanstack/* resolutions dated 2026-05-11. The IOC fingerprint is an optionalDependencies entry pointing to "@tanstack/setup": "github:tanstack/router#79ac49eedf774dd4b0cfa308722bc463cfe5885c" and a router_init.js file at the package root.
  2. If you find a hit, rotate everything reachable from that install host. AWS, GCP, Kubernetes, Vault, GitHub, npm, and SSH credentials.
  3. Pin to known-good versions. TanStack has deprecated all 84 affected versions and npm security pulled the tarballs.
  4. Audit your own pull_request_target workflows. If any of them checks out a fork's code and runs it, you have the same primitive sitting in your CI.

Lessons learnt

pull_request_target is a bad security practice and has been documented for over three years. TanStack had it in production, and so does a meaningful fraction of every popular OSS repo on GitHub right now. Worth running zizmor against your workflows this week.

Read the full postmortem here