Malicious Code Injection in confused_rat_z3n Package
Summary
MAL-2025-100848: Malicious code in confused_rat_z3n (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 confused_rat_z3n package is part of the npm ecosystem, which is widely used for JavaScript development. This package has been identified as part of a malicious campaign that aims to exploit npm's publishing system. It is designed to automatically generate and publish derivative packages with randomized names, which can inflate developer reputation scores for token rewards in the tea.xyz protocol. The presence of such malicious packages poses a significant risk to developers and users relying on npm for secure package management.
Vulnerability Detail
The vulnerability in the confused_rat_z3n package stems from its malicious payload that modifies the package.json file. It removes private flags, alters version numbers, and generates random package names, leading to the continuous republishing of variants that pollute the npm registry. This behavior can compromise the integrity of the npm ecosystem, making it difficult for developers to trust the packages they use. The origin of this vulnerability is linked to the tea.xyz token reward campaign, which has flooded npm with similar malicious packages.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall confused_rat_z3n
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 avoid using the confused_rat_z3n package and replace it with a trusted alternative. Ensure that you review the packages you include in your project and verify their integrity before installation.
Conclusion
The confused_rat_z3n package poses a significant security risk due to its malicious behavior of modifying package.json files and republishing variants. It is crucial for developers to remove this package from their projects and monitor their dependencies for vulnerabilities. Utilizing tools like Vulert can help in maintaining the security of your applications.
See every vulnerability recorded for confused_rat_z3n →
FAQ
The confused_rat_z3n package is an npm package identified as part of a malicious campaign that exploits npm's publishing system.
The vulnerability can compromise the integrity of your project by introducing malicious code that modifies your package.json and republish variants, potentially leading to security risks.
You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without any signup.
If you have installed the confused_rat_z3n package, you should uninstall it immediately using the command npm uninstall confused_rat_z3n.
Yes, consider using trusted and well-maintained packages that serve the same purpose as confused_rat_z3n, ensuring they are free from vulnerabilities.