Malicious Code Injection in legislative_dragonfly_z3n Package - npm Vulnerability
Summary
MAL-2025-95216: Malicious code in legislative_dragonfly_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 legislative_dragonfly_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 npm with malicious packages. The primary functionality of this package is to facilitate token rewards, but it has been compromised to include harmful scripts that manipulate package metadata.
Vulnerability Detail
This vulnerability originates from the malicious intent behind the legislative_dragonfly_z3n package, which contains scripts designed to automatically generate and publish derivative packages with randomized names. These scripts modify the package.json file to remove private flags, alter version numbers, and continuously republish variants, leading to pollution of the npm registry. The ramifications include potential security risks for developers who unknowingly use these packages, as they may inadvertently expose their applications to malicious code.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall legislative_dragonfly_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, avoid using the legislative_dragonfly_z3n package and consider using alternative packages that provide similar functionality without the associated risks.
Conclusion
The legislative_dragonfly_z3n package has been identified as a source of malicious code that can compromise the integrity of applications using it. It is crucial for developers to be vigilant about the packages they include in their projects and to utilize tools like Vulert for real-time monitoring of vulnerabilities.
See every vulnerability recorded for legislative_dragonfly_z3n →
FAQ
It is an npm package that has been compromised to include malicious code aimed at manipulating package metadata and inflating developer reputation scores.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By checking your package-lock.json file, you can identify vulnerabilities without needing to access the code.
You should uninstall the legislative_dragonfly_z3n package immediately and check for any other potentially compromised packages in your project.
Regularly monitor your dependencies using tools like Vulert and keep your packages updated to their latest versions to minimize security risks.
Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.