Malicious Code Injection in benjamincooper Package - npm Vulnerability
Summary
MAL-2025-170966: Malicious code in benjamincooper (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 benjamincooper package is part of the npm ecosystem, often utilized for various JavaScript applications. It is designed to facilitate the management of dependencies and enhance developer productivity. However, this package has been identified as part of a malicious campaign that exploits npm's publishing mechanisms, leading to significant security concerns.
Vulnerability Detail
The vulnerability originates from a malicious payload embedded within the benjamincooper package. This payload modifies the package.json file to remove private flags, alters version numbers, and generates random package names, which are then republished to the npm registry. This behavior not only inflates developer reputation scores for token rewards but also pollutes the npm registry with potentially harmful packages, posing risks to developers who unknowingly install them.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall benjamincooper
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 workaround, you can remove the benjamincooper package from your project by executing 'npm uninstall benjamincooper'. This will prevent any malicious code from executing until a secure version is available.
Conclusion
The benjamincooper package has been identified as a vector for malicious code injection, posing significant risks to developers and their applications. It is crucial to stay informed about such vulnerabilities and take proactive measures to secure your projects.
See every vulnerability recorded for benjamincooper →
FAQ
The malicious code modifies package.json files and republishes variants to inflate developer reputation scores.
You can use Vulert's playground at Vulert Scanner to check if your application is affected without needing to sign up.
Using the benjamincooper package can lead to the installation of malicious derivatives that compromise your application's security.
Regularly audit your dependencies and use tools like Vulert to monitor for vulnerabilities in real-time.
Immediately uninstall the package and check for any unauthorized changes in your project files.