Malicious code in secretkey2fa (npm)
Description
The npm package 'secretkey2fa' version 1.0.1, advertised as a lightweight TOTP/HOTP library, contains malicious code executed via a postinstall hook. This code steals Windows credentials by enumerating Credential Manager entries, extracts Microsoft Account tokens from Minecraft launcher files, decrypts Chromium browser cookies and credentials, and exfiltrates this data to a concealed Discord webhook. The malicious payload activates only on real Windows developer environments, avoiding CI and audit contexts. The 2FA functionality is a cover story for this credential-stealing malware.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The 'secretkey2fa' npm package version 1.0.1 includes a postinstall script ('node lib/core.js') that runs a Windows credential stealer. It uses inline P/Invoke PowerShell to enumerate Windows Credential Manager entries matching specific patterns, reads Microsoft Account refresh and access tokens from Minecraft launcher account JSON files, and exchanges these tokens at Microsoft and Xbox Live endpoints to obtain session identifiers. Additionally, it decrypts Chromium browser cookies and credentials using DPAPI and AES-256-GCM decryption. The harvested data is sent as JSON and multipart file uploads to a Discord webhook URL hidden via XOR obfuscation. The payload includes environment checks to avoid running in CI or audit environments, targeting real Windows developer hosts. The advertised 2FA functionality is a decoy to mask the malicious intent.
Potential Impact
This malicious package compromises Windows user credentials, including Windows Credential Manager entries, Microsoft Account tokens, and Chromium browser cookies and credentials. This can lead to unauthorized access to user accounts, including Microsoft and Xbox Live services, and potentially other services relying on stored credentials. The exfiltration of sensitive authentication data to a remote Discord webhook poses a significant privacy and security risk to affected users.
Defensive Guidance
Users should immediately uninstall the 'secretkey2fa' package version 1.0.1 and avoid using it. Since no patch or official fix is indicated, users should remove any installed instances and scan affected systems for credential theft indicators. Use trusted and verified 2FA libraries from reputable sources. Monitor for unauthorized access to Microsoft and Xbox Live accounts and change passwords and tokens if compromise is suspected. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-15559
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a92f7d9acd9273b49e75a90
Added to database: 08/29/2026, 15:16:41 UTC
Last enriched: 09/09/2026, 21:37:39 UTC
Last updated: 10/04/2026, 07:38:43 UTC
Views: 25
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.