Malicious Code Injection in node-env-resolve: A Critical Security Threat
Summary
MAL-2026-17681: Malicious code in node-env-resolve (npm). Affects node-env-resolve versions 1.2.3. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
node-env-resolve is an npm package designed to resolve environment configurations for Node.js applications. It is typically used to manage environment variables and settings in a user-friendly manner. However, this package has been found to contain malicious code that compromises user systems by installing hidden agents and enabling unauthorized access.
Vulnerability Detail
The vulnerability originates from the postinstall script of the node-env-resolve package, which installs a persistent agent in user-level directories disguised as legitimate Node tooling. This agent registers for autostart on various operating systems and connects to a command-and-control server. It can capture sensitive information, including screen content, microphone audio, and filesystem operations, leading to complete system compromise. The internal naming conventions used by the malicious code are designed to obscure its true nature, making detection difficult.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall node-env-resolve
If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary measure, you can prevent the malicious code from executing by removing the package from your project. Use the following command to uninstall the package: 'npm uninstall node-env-resolve'. However, be aware that this may not eliminate all traces of the malicious software.
Conclusion
The discovery of malicious code in the node-env-resolve package poses a significant threat to users. Immediate action is required to remove the package and secure any compromised systems. Regular monitoring for vulnerabilities is essential to maintain the integrity of your software environment.
See every vulnerability recorded for node-env-resolve →
FAQ
Immediately uninstall the package and rotate any sensitive information stored on your system.
The malicious code installs a hidden agent that connects to a remote server, allowing unauthorized access to your system.
While many npm packages are safe, always review package details and community feedback before installation.
You can use tools like Vulert, which monitors your package-lock.json for vulnerabilities in real-time without requiring code access.
Yes, you can use the Vulert playground at Vulert Scanner to check for vulnerabilities in your application without signing up.