Malicious code in 2fasecretkey (npm)
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.
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 '2fasecretkey' npm package versions 1.1.2, 1.1.3, and 1.1.4 include a postinstall script that performs an HTTP GET request to a hardcoded IP address (http://185.14.92.233:7777/p.js) without any integrity checks. The response is saved to a temporary file and executed via a detached wscript.exe invocation of a VBS stager, which runs the Node executable with the downloaded payload in a hidden window. This remote code execution occurs at install time and is concealed from the user. The package's legitimate purpose as a TOTP helper does not justify this behavior, indicating malicious intent.
Potential Impact
Installation of affected versions results in execution of arbitrary remote code fetched over an unencrypted and unauthenticated channel, potentially compromising the installing system. The hidden execution method conceals the activity from the user, increasing the risk of unnoticed compromise. There is no indication of known exploits in the wild at this time.
Mitigation Recommendations
No official patch or remediation is currently available. Users should avoid installing versions 1.1.2, 1.1.3, and 1.1.4 of '2fasecretkey'. Consider removing the package if already installed. Monitor for vendor advisories for updates or official fixes. Since this is a malicious package, sourcing TOTP helpers from trusted and verified packages is recommended.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-15548
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a92f807acd9273b49e90ac9
Added to database: 08/29/2026, 15:17:27 UTC
Last enriched: 09/09/2026, 19:08:53 UTC
Last updated: 10/03/2026, 21:54:14 UTC
Views: 26
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.