Malicious Code Injection in used_butterfly_z3n Package: A Threat to npm Ecosystem
Summary
MAL-2025-91551: Malicious code in used_butterfly_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 used_butterfly_z3n package is part of the npm ecosystem, which is widely used for JavaScript package management. This package is associated with the tea.xyz token reward campaign, which has been known to flood the npm registry with malicious packages. The primary function of this package is to serve as a component in the broader scheme of generating and publishing derivative packages, often with randomized names, to manipulate developer reputation scores for token rewards.
Vulnerability Detail
The vulnerability in the used_butterfly_z3n package stems from its malicious code that modifies the package.json file. This code removes private flags, alters version numbers, and generates random package names, contributing to the pollution of the npm registry. The malicious payload is designed to automatically publish these variants, which can lead to significant security risks, including the potential for dependency confusion and the compromise of developer environments.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall used_butterfly_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 this malicious package by using the following command to uninstall it: npm uninstall used_butterfly_z3n. Additionally, consider using npm audit to identify and address other vulnerabilities in your project.
Conclusion
The used_butterfly_z3n package poses a significant threat to the npm ecosystem due to its malicious code that alters package metadata and publishes harmful variants. It is essential for developers to remain vigilant, regularly audit their dependencies, and utilize tools like Vulert to ensure their projects remain secure.
See every vulnerability recorded for used_butterfly_z3n →
FAQ
The used_butterfly_z3n package is an npm package that has been identified as malicious, part of a scheme to manipulate developer reputation scores through the creation of derivative packages.
This vulnerability can lead to the automatic generation of malicious packages, potentially compromising your project's integrity and security by polluting the npm registry.
You should immediately uninstall the used_butterfly_z3n package and monitor your project for any other vulnerabilities using tools like npm audit.
Yes, you can use tools like Vulert, which monitors your package-lock.json file to alert you in real-time for open-source vulnerabilities without requiring code access or installation.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.