2fasecretkey (npm) · Malicious Code
Affects 2fasecretkeySource GCVE Database
Malicious package : remove 2fasecretkey and rotate any secrets on hosts that installed it.
Data as of 9 Sep 2026, 19:08 UTC
Malicious package
Published to npm · OSV MAL-2026-15548
What to do
Remove 2fasecretkey from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npm2fasecretkey | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
The npm package '2fasecretkey' versions 1.1.2, 1.1.3, and 1.1.4 contains malicious code that executes during installation. Its postinstall script fetches and executes remote code via an unprotected HTTP request to a hardcoded IP address, running the payload hidden from the user. This behavior is unrelated to the package's advertised function as a TOTP helper and poses a risk of executing arbitrary code on the installing system.