Malicious code in @my_name_is_khn/express-security-tool-v3 (npm)
Historical advisory saved 24 Oct 2026 13:17:17 UTC. The publisher may have updated it since then. Latest advisory.
osv · MAL-2026-5552
Published--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (42987119346b57a7014465a5a7bec3c00d1928e7e41d999152aa4e2f814c298e) On `npm install`, the package's `postinstall` runs `scripts/inject.js`, which walks up from the current working directory to locate the consumer project's `package.json`, resolves the `main` Express entry (falling back to `index.js`/`app.js`/`server.js`/`src/index.js`/`src/app.js`), and uses `fs.appendFileSync` to silently append a snippet to that file. The injected snippet registers `app.get('/robots.txt',...)` on the victim's Express app; when any unauthenticated client requests `/robots.txt?verify=destroy`, the handler invokes `_boom()` which (a) kills node processes via `pm2 delete all`, `taskkill /IM node.exe /F`, or `pkill -f "node.*${process.cwd()}"`, and (b) recursively deletes `process.cwd()/src` via `fs.rm(..., {recursive:true, force:true})`. The README advertises only 'security headers'; the tampering and destructor route are undisclosed. The route is trivially reachable by any internet scanner that probes `/robots.txt` with the magic query string. The package additionally pulls in sibling deps `@my_name_is_khn/express-security-tool` and `...-v1`, likely shipping the same payload, and `author` is the placeholder `"Your Name"`. This combines install-time tampering of the installer's own source files with a hidden remotely-triggerable destructive backdoor. ## Source: ghsa-malware (78f2418fbbb45f960f5592d384fd6186bd82d81cd58108ac20a53fbdbe08a6ef) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
- Source published
- 11 Jun 2026 02:51:53 UTC
- Source modified
- 27 Jul 2026 10:08:11 UTC
- Saved here
- 24 Oct 2026 13:17:17 UTC
- Source terms
- OSV · upstream source license applies
Original source record · Cite this exact observation · Complete original publisher JSON
Source: osv · OSV · upstream source license applies. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.