Malicious Code Injection in improved_weasel_z3n: A Threat to npm Ecosystem
Summary
MAL-2025-104036: Malicious code in improved_weasel_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 package 'improved_weasel_z3n' is part of a series of malicious npm packages that emerged during the tea.xyz token reward campaign. These packages are designed to inflate developer reputation scores by automatically generating and publishing derivative packages with randomized names. The malicious nature of this package lies in its ability to alter the package.json file, removing private flags and changing version numbers, which can lead to significant security risks within the npm ecosystem.
Vulnerability Detail
The vulnerability in 'improved_weasel_z3n' originates from its association with a malicious campaign aimed at manipulating the npm registry. The package contains scripts that automatically publish variants of itself, polluting the npm registry with potentially harmful packages. This behavior not only compromises the integrity of the npm ecosystem but also poses risks to developers who may unknowingly incorporate these malicious packages into their projects. The payload modifies the package.json file, which can lead to unintended exposure of sensitive information and further exploitation.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall improved_weasel_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 workaround, you can temporarily avoid using 'improved_weasel_z3n' and monitor your project for any dependencies that may have been affected by this malicious package. Additionally, consider using tools like Vulert to monitor your package-lock.json for vulnerabilities.
Conclusion
The 'improved_weasel_z3n' package poses a significant threat to the npm ecosystem due to its malicious behavior of modifying package files and publishing harmful variants. It is crucial for developers to be vigilant, remove such packages, and utilize tools like Vulert to ensure the security of their applications.
See every vulnerability recorded for improved_weasel_z3n →
FAQ
'improved_weasel_z3n' is a malicious npm package that is part of a campaign to inflate developer reputation scores by publishing derivative packages.
The vulnerability can lead to the exposure of sensitive information and the introduction of malicious code into your project, compromising its security.
You should remove 'improved_weasel_z3n' from your project immediately and monitor for any dependencies that may have been affected.
Regularly audit your dependencies, use tools like Vulert to monitor for vulnerabilities, and keep your packages updated to their latest secure versions.
Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.