Malicious Code Injection in enum-new-encode-tree-cluster Package
Summary
MAL-2025-186766: Malicious code in enum-new-encode-tree-cluster (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 enum-new-encode-tree-cluster package is part of the npm ecosystem, often utilized in JavaScript projects for encoding tree structures. However, this package has been identified as part of a malicious campaign that floods the npm registry with harmful scripts designed to manipulate package metadata and inflate developer reputation scores. The malicious nature of this package poses significant risks to developers and their applications.
Vulnerability Detail
The vulnerability stems from the inclusion of malicious code within the enum-new-encode-tree-cluster package. This code modifies the package.json file by removing private flags, altering version numbers, and generating random package names. The primary goal is to automatically publish derivative packages, polluting the npm registry and potentially compromising the integrity of projects that depend on this package. The origin of this vulnerability is linked to a broader campaign associated with the tea.xyz token reward initiative, which exploits npm's publishing mechanisms.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall enum-new-encode-tree-cluster
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 npm's package-lock.json to monitor dependencies. Ensure that your project does not include enum-new-encode-tree-cluster in its dependencies. You can also utilize tools like Vulert to monitor your project for vulnerabilities without needing to access the code directly.
Conclusion
The enum-new-encode-tree-cluster package has been identified as a malicious entity within the npm ecosystem, posing significant risks to developers. It is essential to remove this package from your projects and utilize tools like Vulert for ongoing monitoring of vulnerabilities. Staying informed and proactive is key to maintaining the security of your applications.
See every vulnerability recorded for enum-new-encode-tree-cluster →
FAQ
It is an npm package used for encoding tree structures, but it has been compromised with malicious code.
The malicious code modifies your package.json, removes private flags, and publishes harmful variants, potentially compromising your project's integrity.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
You should uninstall the package immediately using npm uninstall enum-new-encode-tree-cluster and monitor your project for any further vulnerabilities.
Currently, there is no specific patched version available. The best course of action is to uninstall the package and monitor for updates.