2fa-secretkey (npm) · Malicious Code
Affects 2fa-secretkeySource GCVE Database
Malicious package : remove 2fa-secretkey and rotate any secrets on hosts that installed it.
Data as of 9 Sep 2026, 21:37 UTC
Malicious package
Published to npm · OSV MAL-2026-15547
What to do
Remove 2fa-secretkey 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 |
|---|---|---|
| npm2fa-secretkey | 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 '2fa-secretkey' contains malicious code that executes automatically upon installation. It runs a hidden payload on Windows systems that collects sensitive credentials, including Windows Credential Manager secrets, Microsoft refresh tokens, JWT access tokens, Minecraft session IDs, and decrypted Chromium browser cookies and stored credentials. This stolen data is exfiltrated to a hardcoded Discord webhook URL unrelated to the package's advertised functionality. The payload includes environment checks to avoid execution in CI environments or non-Windows systems. Multiple specific versions of the package are affected.
References
- npmjs.com/package/2fa-secretkey/v/1.0.3 (opens in a new tab)
- npmjs.com/package/2fa-secretkey/v/1.0.5 (opens in a new tab)
- npmjs.com/package/2fa-secretkey/v/1.0.7 (opens in a new tab)
- npmjs.com/package/2fa-secretkey/v/1.0.4 (opens in a new tab)
- npmjs.com/package/2fa-secretkey/v/1.0.2 (opens in a new tab)
- npmjs.com/package/2fa-secretkey/v/1.0.6 (opens in a new tab)
- npmjs.com/package/2fa-secretkey/v/1.0.1 (opens in a new tab)