Malicious Code Injection in harsh_weasel_z3n: A Threat to npm Ecosystem
Summary
MAL-2025-103615: Malicious code in harsh_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 'harsh_weasel_z3n' is part of a series of npm packages that emerged during the tea.xyz token reward campaign. These packages are designed to manipulate the npm registry by creating and publishing numerous derivative packages with randomized names. This behavior is intended to inflate developer reputation scores for rewards associated with the tea protocol, making it a significant concern for developers relying on npm for package management.
Vulnerability Detail
The vulnerability in 'harsh_weasel_z3n' stems from its malicious code, which modifies the package.json file to remove private flags and alters version numbers. It generates random package names, often themed around Indonesian culture, and continuously republishes these variants to pollute the npm registry. This not only compromises the integrity of the npm ecosystem but also poses risks to developers who may unknowingly use these compromised packages.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall harsh_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 temporary measure, you can avoid using 'harsh_weasel_z3n' and any other packages associated with the tea.xyz campaign. Regularly audit your dependencies using tools like npm audit to identify and mitigate vulnerabilities.
Conclusion
The 'harsh_weasel_z3n' package poses a significant threat to the npm ecosystem due to its malicious code that alters package metadata and floods the registry with derivative packages. It is crucial for developers to remain vigilant, regularly audit their dependencies, and utilize tools like Vulert to monitor for vulnerabilities.
See every vulnerability recorded for harsh_weasel_z3n →
FAQ
'harsh_weasel_z3n' is an npm package that is part of a malicious campaign to inflate developer reputation scores through the creation of numerous derivative packages.
This vulnerability can compromise the integrity of your project by introducing malicious code that alters your package.json file and pollutes the npm registry.
You should uninstall the package immediately using 'npm uninstall harsh_weasel_z3n' and audit your project for other potentially malicious dependencies.
You can use tools like npm audit or services 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 if your application is affected by this vulnerability without needing to sign up.