npm · Malicious package advisory
Malwarepublish-poc-test3
GHSA-mq69-4j49-gmx8
Malicious code in publish-poc-test3 (npm)
Details
**Severity:** Critical
**Affected versions:** `= 1.0.15`
## Source: amazon-inspector (4001a75b24abfa181a10e5d40931194f254304fcf5fda554488d3c242cc5db85)
The package's postinstall lifecycle script creates a temporary directory, writes a fabricated package.json whose name is 'publish-poc-found-<random-hex>' (random suffix derived via 'openssl rand -hex 2'), and then invokes 'npm publish' from that directory. The literal string 'npm publish' is reconstructed at runtime by concatenating three fragments ('np', 'm pu', 'blish') through printf, specifically to prevent manifest and string scanners from matching the command. The publish runs against the public npm registry using whatever npm authentication context the installing environment currently has (an _authToken from ~/.npmrc, NPM_TOKEN / NODE_AUTH_TOKEN in the environment, or an active CI publish identity), so running 'npm install' of this package on a developer workstation or CI host that holds publish rights causes a new attacker-named package to be published under the installer's npm identity. The combination of credential abuse at install time, randomized attacker-chosen package naming, and deliberate obfuscation of the exact command performing the publish is characteristic registry self-propagation / worm behavior.
---
Credit: [OpenSSF](https://github.com/ossf/malicious-packages) ([source](https://github.com/ossf/malicious-packages/blob/4f27542fecd13e7f077489c04a2f3503d1189f32/osv/malicious/npm/publish-poc-test3/MAL-2026-18324.json))
**References:**
- https://github.com/ossf/malicious-packages/blob/4f27542fecd13e7f077489c04a2f3503d1189f32/osv/malicious/npm/publish-poc-test3/MAL-2026-18324.json
- https://www.npmjs.com/package/publish-poc-test3/v/1.0.15
- https://www.npmjs.com/package/publish-poc-test3/v/1.0.18
- https://www.npmjs.com/package/publish-poc-test3/v/1.0.19
- https://www.npmjs.com/package/publish-poc-test3/v/1.0.21
- https://www.npmjs.com/package/publish-poc-test3/v/1.0.22
- https://www.npmjs.com/package/publish-poc-test3/v/1.0.26
- https://www.npmjs.com/package/publish-poc-test3/v/1.0.27Compromised versions (1)
- = 1.0.15
Any computer that installed or ran a compromised version should be considered fully compromised. Rotate every secret on that machine from a clean environment.