Malicious code in dotenv-native (npm)
The npm package dotenv-native (version 1.0.1) is a malicious typosquat of the popular dotenv package family. It executes attacker-controlled code on module load by extracting and decoding a hidden payload from a bundled JPEG file, writing a VBScript file, and launching PowerShell with an encoded command on Windows hosts. The package also includes an obfuscated decode-and-eval remote code execution primitive. Both requiring the package as a dependency or running its CLI triggers the malicious payload.
AI Analysis
Technical Summary
The dotenv-native npm package (version 1.0.1) is a malicious typosquatting package that executes arbitrary code on Windows systems upon loading. It contains a dispatchAnalytics routine that extracts a base64-encoded PowerShell command hidden in the EXIF segment of a bundled JPEG file, writes a relay_*.vbs script to a temporary directory, and launches wscript.exe to run PowerShell with the decoded command. The package uses string splitting and joining to evade static detection. Additionally, it includes an obfuscated decode.js script that base64-decodes and RC4-decrypts an embedded payload, then executes it via new Function, providing a remote code execution primitive. Both the main module and CLI entry points trigger this behavior.
Potential Impact
On Windows hosts, simply requiring the package or invoking its CLI results in execution of attacker-controlled code with the privileges of the running process. This can lead to arbitrary code execution, potentially compromising the system. The obfuscation and evasion techniques make detection difficult. There is no indication of known exploits in the wild yet.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should avoid installing or using the dotenv-native package, especially version 1.0.1. Verify dependencies to prevent supply chain compromise via typosquatting. Use trusted package sources and consider scanning for malicious packages. Patch status is not yet confirmed — check the vendor advisory or npm security advisories for updates.
Malicious code in dotenv-native (npm)
Description
The npm package dotenv-native (version 1.0.1) is a malicious typosquat of the popular dotenv package family. It executes attacker-controlled code on module load by extracting and decoding a hidden payload from a bundled JPEG file, writing a VBScript file, and launching PowerShell with an encoded command on Windows hosts. The package also includes an obfuscated decode-and-eval remote code execution primitive. Both requiring the package as a dependency or running its CLI triggers the malicious payload.
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 dotenv-native npm package (version 1.0.1) is a malicious typosquatting package that executes arbitrary code on Windows systems upon loading. It contains a dispatchAnalytics routine that extracts a base64-encoded PowerShell command hidden in the EXIF segment of a bundled JPEG file, writes a relay_*.vbs script to a temporary directory, and launches wscript.exe to run PowerShell with the decoded command. The package uses string splitting and joining to evade static detection. Additionally, it includes an obfuscated decode.js script that base64-decodes and RC4-decrypts an embedded payload, then executes it via new Function, providing a remote code execution primitive. Both the main module and CLI entry points trigger this behavior.
Potential Impact
On Windows hosts, simply requiring the package or invoking its CLI results in execution of attacker-controlled code with the privileges of the running process. This can lead to arbitrary code execution, potentially compromising the system. The obfuscation and evasion techniques make detection difficult. There is no indication of known exploits in the wild yet.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should avoid installing or using the dotenv-native package, especially version 1.0.1. Verify dependencies to prevent supply chain compromise via typosquatting. Use trusted package sources and consider scanning for malicious packages. Patch status is not yet confirmed — check the vendor advisory or npm security advisories for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-17231
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6abb4187f7a7c54106cc2f8c
Added to database: 09/29/2026, 04:41:43 UTC
Last enriched: 09/29/2026, 04:47:32 UTC
Last updated: 09/29/2026, 18:01:01 UTC
Views: 4
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.