Malicious Code Injection in shallow_moth_z3n Package - npm Vulnerability
Summary
MAL-2025-98926: Malicious code in shallow_moth_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 shallow_moth_z3n package is part of the npm ecosystem and has been identified as a component of a malicious campaign targeting developers. This package is designed to automate the generation and publication of derivative packages, which can inflate developer reputation scores for token rewards. Its primary function is to facilitate these automated processes, but it has been compromised to include harmful scripts.
Vulnerability Detail
The vulnerability in the shallow_moth_z3n package stems from its association with the tea.xyz token reward campaign. It contains malicious scripts that modify the package.json file by removing private flags, altering version numbers, and generating random package names. This behavior leads to the continuous republishing of variants, which pollutes the npm registry and can compromise the integrity of the ecosystem. The origin of this vulnerability is linked to the package's design to exploit developer incentives, making it a significant threat to users relying on npm for package management.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall shallow_moth_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 prevent the installation of the shallow_moth_z3n package by using npm's package-lock.json file to monitor dependencies. Ensure that your project does not include this package and regularly audit your dependencies for any malicious packages.
Conclusion
The shallow_moth_z3n package poses a significant threat due to its malicious code designed to manipulate package management processes. It is crucial for developers to be vigilant and remove any instances of this package from their projects to maintain the integrity of their software. Utilizing tools like Vulert can help in monitoring for such vulnerabilities effectively.
See every vulnerability recorded for shallow_moth_z3n →
FAQ
The shallow_moth_z3n package is an npm package that has been identified as part of a malicious campaign aimed at inflating developer reputation scores through automated package publishing.
This vulnerability can compromise the integrity of your project by introducing malicious code that modifies your package.json file and floods the npm registry with unwanted packages.
You should immediately uninstall the shallow_moth_z3n package using npm uninstall shallow_moth_z3n and check your package-lock.json for any references to it.
Yes, you can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time using just your package-lock.json. You can also check your application against known vulnerabilities using the Vulert playground.
You can find detailed information about this vulnerability in the Open Source Vulnerability database or by visiting the GitHub repository for malicious packages.