nested-libnpm
Advisory published Updated
nested-lib is a confirmed malicious npm package (MAL-2026-17773) that opens a backdoor for remote access (malicious versions 1.0.0, 1.0.1, 1.1.0). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in nested-lib (npm)
What this malware does
The package declares scripts.postinstall = "node beacon.cjs" and index.js also invokes require('./beacon.cjs').fire() at module load. beacon.cjs POSTs a JSON payload containing os.hostname(), __dirname, process.cwd(), and process.version over plain HTTP to the hardcoded bare-IP endpoint http://185.158.107.175:8787/_ah/dc. The destination is not a documented first-party service and the host identifiers are sent without any opt-in. index.js otherwise exports a Proxy that returns no-op functions for every property access, so the package provides no real functionality — its sole on-install and on-require effect is the beacon. The combination of a hollow Proxy shim, a bare-IP plain-HTTP destination, and automatic firing from both the npm lifecycle hook and the main module is consistent with a reconnaissance/confirmation beacon used to validate successful installation into target environments, typically preceding a second-stage payload.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Backdoor / remote accessFind it
Search your lockfiles and build artifacts for nested-lib (3 malicious versions).
If you installed it — respond
nested-lib establishes remote access, so treat any host that installed it as fully compromised. Isolate the machine, remove the package, rotate all credentials it could reach, and rebuild from a trusted image rather than cleaning in place — a backdoor may have planted additional persistence.
Did it already run?
If nested-lib was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks nested-lib-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the C2 callback and severs the channel.