express-self-destruct2
This report shows the evidence for express-self-destruct2@1.0.0, the only known version.
OpenSSF/OSV Malicious Advisory
imported 3mo ago · by OpenSSF/OSVOpenSSF/OSV advisory MAL-2026-5554 confirms this npm version as malicious.
Advisory
MAL-2026-5554
Source
OpenSSF Malicious Packages via OSV
Summary
Malicious code in express-self-destruct2 (npm)
Details
On install, the package's postinstall hook (scripts/inject.js) locates the installer's project root and main entry (from package.json or fallbacks app.js/server.js), detects the Express `app` variable, and silently appends a hidden `/robots.txt` route handler to the installer's own source file. When the route is hit with `?verify=destroy`, the injected handler runs `npx pm2 delete all`, `taskkill /IM node.exe /F` (Windows) or `pkill -f "node.*<cwd>"` (Unix), and recursively `fs.rm`s the project's `src/` directory. The library's main module (index.js) additionally exports `armSelfDestruct(app, options)` which registers the same destructive route programmatically: on `?verify=destroy` it executes `pkill -f "node.*${process.cwd()}"` and `fs.rm(process.cwd() or process.cwd()/<deleteFolder>, { recursive: true, force: true })` — `deleteFolder=''` wipes the entire working directory. package.json also declares a dependency on the sibling package `express-self-destruct1` despite the README advertising `zero dependencies`, pulling additional related code into the installer's tree. The combination — install-time source tampering plus a shipped, attacker-triggerable process-kill + rm-rf primitive — is destructive supply-chain malware regardless of advertised purpose.
## Source: ghsa-malware (5aaefa71ba1513e6d587ba499a230a3721d03001f1ff4621b6181134ecc4a08f) 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.
References
Source & flagged code
0 flagged · loading sourceNo flagged code excerpts are attached to this scan.
Findings
1 High
HighOsv Malicious Advisory
Affected versions and remediation
This report applies to express-self-destruct2@1.0.0.
The versions list below shows the verdict for each recorded version.
- Avoid installing express-self-destruct2@1.0.0. Remove it from direct dependencies and check your lockfile for transitive copies.
- Choose an independently verified alternative or release. This report does not establish that other versions are safe.
- If this version ran, investigate the affected machine and build environment. Rotate credentials it could access and rebuild from a trusted environment.
Evidence last updated: .
Source advisory published: .
This report uses published external intelligence. The advisory does not provide a separate source-code analysis for each listed version.
Think this verdict is wrong? Dispute it on GitHub or read how reports are produced.