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

推荐订阅源

Recent Announcements
Recent Announcements
人人都是产品经理
人人都是产品经理
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
GbyAI
GbyAI
博客园 - 司徒正美
美团技术团队
Vercel News
Vercel News
IT之家
IT之家
U
Unit 42
Y
Y Combinator Blog
罗磊的独立博客
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
V
Visual Studio Blog
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
MyScale Blog
MyScale Blog
博客园 - 叶小钗
A
About on SuperTechFans
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
B
Blog RSS Feed

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
What now? explaining the TanStack Supply Chain Attack
Paulo Victor · 2026-05-12 · via DEV Community

If you install any tanstack package you might be affected. That it, on May 11, 2026, one of the most sophisticated npm supply chain attacks ever seen hit the JavaScript ecosystem, and it's still spreading.

omg

This is my attempt to explain it simply, because the technical details are buried in postmortems and most developers I know haven't fully digested what this means for them.

What happened

The attackers compromised 42 TanStack packages, publishing 84 malicious versions in a 6-minute window. TanStack is widely used, Query, Router, Start, so the blast radius was insane.

But here's what makes this different from a typical "someone hacked a maintainer's account" story: no passwords were stolen. The attackers never needed them.

The clever part: the attack chain

The attacker opened a pull request to TanStack's GitHub repo. Looks innocent. But they exploited three things in sequence:

1. A dangerous GitHub Actions trigger

The workflow used pull_request_target instead of pull_request. The difference sounds minor but it's huge. pull_request_target runs in the context of the base repository, meaning it has access to secrets and can write to the Actions cache — even from a forked PR.

2. Cache poisoning

The malicious PR code ran during CI and wrote a poisoned 1.1 GB cache entry keyed to match what the release workflow would look up on the next push to main. Then the attacker quietly reverted the PR to a no-op and closed it. The cache stayed poisoned.

3. OIDC token theft

When a legitimate maintainer merged an unrelated PR days later, the release workflow started, restored the poisoned cache, and the malware ran inside the trusted CI context. It then minted a short-lived OIDC token (the kind used for "Trusted Publishing" on npm) and published the malicious versions directly — all while the legitimate workflow showed a failure status.

No npm credentials. No compromised passwords. Just a poisoned cache waiting for the right moment.

What the malware does

Once installed via npm install, it:

  • Harvests AWS credentials, GitHub tokens, npm tokens, SSH keys, Kubernetes service account tokens
  • Exfiltrates everything over an end-to-end encrypted channel (Session messenger's network), so you can't even block it by IP easily
  • Self-propagates: looks up every package you maintain on npm and republishes them with the same payload This is a worm. It uses your own credentials to infect your own packages and spread to your users.

Are you affected?

Check if you installed or updated any @tanstack/* packages on the evening of May 11, 2026 (UTC). If yes, assume the machine that ran npm install is compromised.

Rotate immediately:

  • AWS credentials
  • GitHub personal access tokens
  • npm tokens
  • SSH private keys
  • Any secrets that lived in environment variables on that machine ## How to protect yourself going forward

A few practical things you can actually do:

Don't develop on your host OS. Use Docker dev containers or VMs. If a postinstall script runs malware, it should be contained — not running as you on your machine with access to ~/.ssh and ~/.aws.

Don't store secrets in .env files. Use a proper secrets manager — Doppler, Infisical, AWS SSO. Your credentials shouldn't be sitting in plaintext files reachable by any package lifecycle script.

Configure your package manager to be defensive. Tools like pnpm and Bun let you disable postInstall scripts by default and require opt-in per package. Some support a minimum package age policy (don't install anything published less than 24 hours ago) — which alone would have protected against this attack.

If you maintain npm packages, audit your GitHub Actions workflows right now. If you use pull_request_target, understand exactly what it can access. Lock down cache permissions. Restrict id-token: write only to the specific job that needs it.


The frequency of these attacks is increasing. The sophistication too. This one had a 8-hour delay between poisoning the cache and detonating — patient, precise, automated.

The ecosystem isn't going to fix this overnight. But you can make your own environment significantly harder to compromise.

Stay skeptical of npm install now.


References