홈으로 돌아가기
Hacker News

TanStack NPM 패키지 보안 침해

TanStack NPM Packages Compromised

1044 points 434 comments varunsharma07 2026-05-12 06:08

댓글

20
varunsharma07 2026-05-12 06:08
ENGLISH (원문)
The Mini Shai-Hulud worm is actively compromising legitimate npm packages by hijacking CI/CD pipelines and stealing developer secrets. StepSecurity's OSS Package Security Feed first detected the attack in official @tanstack packages and is tracking its spread across the ecosystem in real time.
ChoosesBarbecue 2026-05-12 06:48
ENGLISH (원문)
> Please be careful when revoking tokens. It looks like the payload installs a dead-man's switch at ~/.local/bin/gh-token-monitor.sh as a systemd user service (Linux) / LaunchAgent com.user.gh-token-monitor(macOS). It polls api.github.com/user with the stolen token every 60s, and if the token is revoked (HTTP 40x), it runs rm -rf ~/. (It looks like it might also have a bunch of persistence mechanisms. I haven't studied these closely.) Jesus, that's vindictive.
janice1999 2026-05-12 06:51
ENGLISH (원문)
How did you guys detect it? Do you use it internally or do you monitor popular packages?
fabian2k 2026-05-12 06:58
ENGLISH (원문)
At least it was only online for 1-2 hours at most, and it didn't affect react-query. But still a bunch of quite well-known packages. This doesn't really feel sustainable, you're rolling the dice every time the dependencies are updated.
gajus 2026-05-12 07:00
ENGLISH (원문)
Reminder to secure your npm environments. https://gajus.com/blog/3-pnpm-settings-to-protect-yourself-f... Just a handful of settings to save a whole lot of trouble.
rvz 2026-05-12 07:02
ENGLISH (원문)
Once again, Shai-Hulud wrecking havock in the Javascript and Typescript ecosystems via NPM. One of the worst ecosystems that has been brought into the software industry and it is almost always via NPM. Not even Cargo (Rust) or go mod (Golang) get as many attacks because at least with the latter, they encourage you to use the standard library. Both Javascript and Typescript have none and want you to import hundreds of libraries, increasing the risk of a supply chain attack. At this point, JS and TS are considered harmful.
sn0n 2026-05-12 07:03
ENGLISH (원문)
As Theo goes live…
Narretz 2026-05-12 07:04
ENGLISH (원문)
Isn't this article wrong about npm minumum release age. 1. The config is min-release-age. 2. For some reason they have chosen to make it days instead of minutes: https://docs.npmjs.com/cli/v11/using-npm/config#min-release-... Completely unforced fragmentation of the dependency manager space imo
rvz 2026-05-12 07:06
ENGLISH (원문)
And absolutely pin, pin, pin, ALL your dependencies. If I see a package version dependency that looks like this: ^1.0.0 or even this: "*", then stop reading, pin it to a secure version immediately.
jonchurch_ 2026-05-12 07:06
ENGLISH (원문)
It is unfortunate, but this is evidence (IMO) that Trusted Publishing is still ~~not secure~~ not enough by itself to securely publish from CI, as an attacker inside your CI pipeline or with stolen repo admin creds can easily publish. This isnt new information, TP is not meant to guarantee against this, but migrating to TP away from local publish w/ 2fa introduces this class of attack via compomise of CI. (edit: changed "still not secure" to "still not enough by itself" bc that is the point I want to make) Going to Trusted Publishing / pipeline publishing removes the second factor that typically gates npm publish when working locally. The story here, while it is evolving, seems to be that the attacker compromised the CI/CD pipeline, and because there is no second factor on the npm publish, they were able to steal the OIDC token and complete a publish. Interesting, but unrelated I suppose, is that the publish job failed. So the payload that was in the malicious commit must have had a script that was able to publish itself w/ the OIDC token from the workflow. What I want is CI publishing to still have a second factor outside of Github, while still relying on the long lived token-less Trusted Publisher model. AKA, what I want is staged publishing, so someone must go and use 2fa to promote an artifact to published on the npm side. Otherwise, if a publish can happen only within the Github trust model, anyone who pwns either a repo admin token or gets malicious code into your pipeline can trivially complete a publish. With a true second factor outside the Github context, they can still do a lot of damage to your repo or plant malicious code, but at least they would not be able to publish without getting your second factor for the registry.
captn3m0 2026-05-12 07:08
ENGLISH (원문)
The astral blog recently pointed out how they do release gates (manual approvals on release workflows) even with trusted publishing. And sadly, all of the documentation for trusted publishing (NPM/PyPi/Rubygems) doesn't even mention this possibility, let alone defaulting to it.
mediaman 2026-05-12 07:16
ENGLISH (원문)
I could imagine this might also be to try cover its tracks. If it gets 40x it means it's been found, time to nuke everything it can.
chrisweekly 2026-05-12 07:18
ENGLISH (원문)
Postinstall scripts are deadly. Everyone should be using pnpm. Crazy that an "orphan" commit pushed to a FORK(!) could trigger this (in npm clients). IMO GitHub deserves much of the blame here. A malicious fork's commits are reachable via GitHub's shared object storage at a URI indistinguishable from the legit repo. That is absolutely bonkers.
cube00 2026-05-12 07:18
ENGLISH (원문)
Please be careful when revoking tokens. It looks like the payload installs a dead-man's switch at ~/.local/bin/gh-token-monitor.sh as a systemd user service (Linux) / LaunchAgent com.user.gh-token-monitor(macOS). It polls api.github.com/user with the stolen token every 60s, and if the token is revoked (HTTP 40x), it runs rm -rf ~/. https://github.com/TanStack/router/issues/7383#issuecomment-...
herpdyderp 2026-05-12 07:20
ENGLISH (원문)
I was always confused at why people claimed trusted publishing would make any difference to this kind of supply chain attack.
donmcronald 2026-05-12 07:20
ENGLISH (원문)
I'd like to have touch to sign from a YubiKey or similar. The whole idea of trusting the cloud to manage credentials on your behalf seems like a mistake.
fabian2k 2026-05-12 07:21
ENGLISH (원문)
Once you run your app with the updated dependencies, that code is executed anyway. And root or non-root doesn't matter, the important stuff is available as the user running the application anyway.
nathanmills 2026-05-12 07:22
ENGLISH (원문)
TanStack? Jia Tan? Who is falling for this???
captn3m0 2026-05-12 07:28
ENGLISH (원문)
1. _Multiple third-party companies_ can detect these obviously malicious packages in almost-real-time 2. NPM still not only publishes them, but also keeps distributing them for anything beyond 5 minutes. Microsoft/GitHub/NPM can only keep repeating "security is our top priority" so many times. But NPM still doesn't detect these simple attacks, and we keep having this every week.
fragmede 2026-05-12 07:29
ENGLISH (원문)
One should always have had backups configured, but if this is what gets people to setup backups, so much the better.

좋아요가 저장됐어요!

로그인하면 어디서나 확인하고
영구적으로 저장할 수 있어요.