Armando identified a malicious version of napi-postinstall, a widely used npm helper with nearly 990 million downloads, that was published on July 18, 2025 as part of the eslint-hack supply chain incident (CVE-2025-54313). Version 0.3.1 was injected with two malicious files -- a Windows DLL infostealer named node-gyp.dll and an obfuscated JavaScript loader install.js -- activated automatically via a new npm install lifecycle hook. The prior version, 0.3.0, is clean.
Key Findings
- Malicious version: v0.3.1, published 2025-07-18; v0.3.0 is clean
- Entry point: install lifecycle hook fires automatically on npm install
- Targets: Windows -- spawns rundll32.exe to execute a bundled DLL infostealer
- Evasion: String concatenation splits module and method names to defeat static pattern matching (
require('chi'+'ld_pro'+'cess')["sp"+"awn"])
- Detection: Script-JS.Trojan.Scavenger, Win64.Infostealer.Scavenger
Package Background
napi-postinstall is a utility that manages the postinstall lifecycle for Node.js packages using native (N-API) bindings, bridging compatibility gaps in older npm versions. It is published under the un-ts organization and maintained by jounqin, a prolific npm contributor responsible for more than 250 packages including eslint-plugin-prettier, eslint-config-prettier, and synckit -- all tools woven into the JavaScript developer toolchain.
The package was first published on April 19, 2025, and had accumulated nearly 990 million downloads by the time the malicious version was detected. It is a transitive dependency of 37 directly importing packages. Its position as infrastructure for native binding management makes it a particularly effective supply chain target: any developer or CI/CD system running npm install with a package that depends on napi-postinstall would silently execute the payload without any additional user action.
Attack Analysis
The attack made minimal changes. Comparing 0.3.0 to 0.3.1 reveals exactly two additions and one manifest change:
install.js -- a new 191-line JavaScript file, not present in 0.3.0
node-gyp.dll -- a new Windows DLL, not present in 0.3.0