Malicious Code Detected in enwrite Package - Security Alert
Summary
MAL-2025-19687: Malicious code in enwrite (npm). Affected versions are not published. 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
The enwrite package is a widely used npm module that facilitates the writing of files in Node.js applications. It is designed to simplify file operations, making it easier for developers to manage file content dynamically. However, recent findings have revealed that this package contains malicious code, posing significant security risks to applications that rely on it.
Vulnerability Detail
The vulnerability in the enwrite package stems from the inclusion of malicious code that can compromise the integrity of applications utilizing this package. This code may lead to unauthorized access, data breaches, or other malicious activities within the affected systems. The issue was introduced in all versions starting from 0, making it imperative for users to take immediate action to mitigate potential risks.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall enwrite
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, users can remove the enwrite package from their project until a secure version is released. This can be done by executing the command: 'npm uninstall enwrite'. Consider using alternative packages that provide similar functionality without the associated risks.
Conclusion
The discovery of malicious code in the enwrite package highlights the importance of maintaining security in open-source software. Users are urged to update their packages promptly and consider alternative solutions to safeguard their applications. Utilizing tools like Vulert can further enhance security by providing real-time monitoring for vulnerabilities.
See every vulnerability recorded for enwrite →
FAQ
The enwrite package is used in Node.js applications to simplify file writing operations, allowing developers to manage file content more efficiently.
The malicious code was identified by security researchers from Amazon Inspector, who conducted a thorough analysis of the enwrite package.
Using the compromised enwrite package can lead to unauthorized access to sensitive data, data breaches, and other malicious activities that can compromise the security of your application.
You can use Vulert, a tool that monitors and alerts you in real-time for open-source vulnerabilities in your software. It requires only the package-lock.json file for analysis.
Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.