Skip to main content

Malicious code in 2fa-secretkey (npm)

0
Critical
Published: 08/29/2026 (08/29/2026, 01:54:48 UTC)
Source: GCVE Database
Product: 2fa-secretkey

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.

Affected software

npmghsa
2fa-secretkey
Affected versions
=1.0.3=1.0.5=1.0.7=1.0.4=1.0.2=1.0.6=1.0.1

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

AILast updated: 09/09/2026, 21:37:52 UTC

Technical Analysis

The '2fa-secretkey' npm package, advertised as a TOTP/2FA helper, contains a postinstall script that launches a detached child process executing obfuscated malicious code. This code reconstructs a Discord webhook URL and uses PowerShell with inline C# to invoke Windows API calls to extract credentials from the Windows Credential Manager, including Microsoft authentication tokens. It also decrypts Chromium browser master keys and extracts cookies and stored credentials. The stolen data is sent to the attacker's Discord webhook. Execution is gated to real Windows user environments by checking environment variables and system paths. The affected versions are 1.0.1 through 1.0.7 inclusive.

Potential Impact

This malicious package compromises the confidentiality of sensitive user credentials on Windows systems, including Microsoft account tokens and browser-stored secrets. The attacker can potentially hijack Microsoft services, Minecraft sessions, and browser sessions, leading to account takeover and unauthorized access. The exfiltration of this data to an external Discord webhook represents a severe privacy and security breach for users who installed the affected package versions.

Defensive Guidance

No official patch or remediation is currently documented. Users should immediately uninstall the '2fa-secretkey' package versions 1.0.1 through 1.0.7 and avoid installing it. Review systems for signs of compromise, especially on Windows machines where the package was installed. Monitor for suspicious PowerShell activity and unauthorized network connections to Discord webhook URLs. Consider resetting affected Microsoft and Minecraft credentials and changing passwords for impacted accounts. Patch status is not yet confirmed — check the vendor advisory or npm security advisories for updates.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-15547
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6a92f7d9acd9273b49e75a85

Added to database: 08/29/2026, 15:16:41 UTC

Last enriched: 09/09/2026, 21:37:52 UTC

Last updated: 10/04/2026, 09:18:42 UTC

Views: 64

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses