Malicious code in safe-local-env-loader (npm)
The safe-local-env-loader npm package impersonates the legitimate dotenv package but contains malicious code that captures desktop screenshots every 3 seconds on Windows and macOS. It exfiltrates these screenshots along with system metadata to a hardcoded command-and-control server. Additionally, it polls the server for remote mouse and keyboard input commands, enabling interactive control of the infected host. On Windows, it establishes persistence by creating a startup script and registry entry to run the malicious agent on every user logon. Any software installing this package is exposed to screen-content theft, remote input injection, and persistent compromise.
AI Analysis
Technical Summary
The safe-local-env-loader npm package (version 1.0.0) is a malicious package that impersonates the legitimate dotenv package by copying its description, repository, homepage, and main code, with an added require call to a hidden module (lib/tui-options.js). This hidden module captures full desktop screenshots every 3 seconds on Windows and macOS and sends them to a hardcoded IP address (http://192.99.204.157:5000/upload). It also polls the same server for mouse and keyboard commands, which it replays on the infected machine using the @nut-tree-fork/nut-js library, allowing remote interactive control. On Windows, it achieves persistence by writing a VBScript to %APPDATA% and adding a registry Run key to execute on user logon. This results in continuous screen-content exfiltration, remote input injection, and persistent execution on affected hosts.
Potential Impact
This malicious package enables attackers to continuously capture sensitive screen content and system metadata, exfiltrate this data to a remote server, and remotely control the victim's mouse and keyboard inputs. The persistence mechanism on Windows ensures the malware runs after system reboots, increasing the risk of prolonged unauthorized access and data theft. Any software depending on this package is compromised, potentially exposing sensitive information and allowing attacker manipulation of the host environment.
Mitigation Recommendations
No official patch or remediation is currently documented for this malicious package. The best mitigation is to avoid using the safe-local-env-loader package entirely. Verify package authenticity before installation, prefer official and well-maintained packages such as the legitimate dotenv, and monitor for unexpected dependencies. Remove any installations of safe-local-env-loader version 1.0.0 immediately and investigate affected systems for signs of compromise, including persistence artifacts and network connections to the indicated IP address.
Malicious code in safe-local-env-loader (npm)
Description
The safe-local-env-loader npm package impersonates the legitimate dotenv package but contains malicious code that captures desktop screenshots every 3 seconds on Windows and macOS. It exfiltrates these screenshots along with system metadata to a hardcoded command-and-control server. Additionally, it polls the server for remote mouse and keyboard input commands, enabling interactive control of the infected host. On Windows, it establishes persistence by creating a startup script and registry entry to run the malicious agent on every user logon. Any software installing this package is exposed to screen-content theft, remote input injection, and persistent compromise.
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 safe-local-env-loader npm package (version 1.0.0) is a malicious package that impersonates the legitimate dotenv package by copying its description, repository, homepage, and main code, with an added require call to a hidden module (lib/tui-options.js). This hidden module captures full desktop screenshots every 3 seconds on Windows and macOS and sends them to a hardcoded IP address (http://192.99.204.157:5000/upload). It also polls the same server for mouse and keyboard commands, which it replays on the infected machine using the @nut-tree-fork/nut-js library, allowing remote interactive control. On Windows, it achieves persistence by writing a VBScript to %APPDATA% and adding a registry Run key to execute on user logon. This results in continuous screen-content exfiltration, remote input injection, and persistent execution on affected hosts.
Potential Impact
This malicious package enables attackers to continuously capture sensitive screen content and system metadata, exfiltrate this data to a remote server, and remotely control the victim's mouse and keyboard inputs. The persistence mechanism on Windows ensures the malware runs after system reboots, increasing the risk of prolonged unauthorized access and data theft. Any software depending on this package is compromised, potentially exposing sensitive information and allowing attacker manipulation of the host environment.
Defensive Guidance
No official patch or remediation is currently documented for this malicious package. The best mitigation is to avoid using the safe-local-env-loader package entirely. Verify package authenticity before installation, prefer official and well-maintained packages such as the legitimate dotenv, and monitor for unexpected dependencies. Remove any installations of safe-local-env-loader version 1.0.0 immediately and investigate affected systems for signs of compromise, including persistence artifacts and network connections to the indicated IP address.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-13741
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a7b6fdbbf8831d5393eb829
Added to database: 08/11/2026, 18:54:19 UTC
Last enriched: 08/11/2026, 19:06:08 UTC
Last updated: 08/11/2026, 19:57:31 UTC
Views: 5
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.