Malware · 103 days ago
The break is that package screening that only looks for npm lifecycle scripts can be fooled. Miasma v2 gets code to run during install through a tiny malicious binding.gyp file, so a package can look script-free and still execute a worm.
Semgrep says the worm has now spread to 57 npm packages across 286+ malicious versions. It harvests AWS, GCP, and Azure credentials, GitHub Actions secrets, and password-store data, then persists in AI coding-assistant configs and forges provenance so reinfected packages look legitimate.
That means the trust boundary has shifted from declared scripts to build metadata. Teams that treat “no preinstall/postinstall” as a safe sign are missing an install path that still runs attacker code and keeps spreading through the package ecosystem.
3 sources covering this story
Node-gyp Supply Chain Compromise | Snyk
A self-propagating npm worm uses binding.gyp and node-gyp to run code at install time, steal secrets, persist in GitHub, and spread through packages.
Miasma v2: Self-Spreading npm Worm Now Uses Malicious binding.gyp file and Compromises 57 Packages
But with a switch from install scripts to binding.gyp, this latest wave has swept up 57 packages across 286+ malicious versions.
Miasma: Supply Chain Attack Targeting RedHat npm Packages | Wiz Blog
Detect and mitigate malicious npm packages linked to the latest npm supply chain attack, based on the open sourced Mini Shai-Hulud malware.
Part of the PlainSec briefing for 2026-06-04