Malicious Code Injection in samehada-hzos-rc7: A Threat to npm Packages
Summary
MAL-2025-165714: Malicious code in samehada-hzos-rc7 (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 'samehada-hzos-rc7' is part of the npm ecosystem, which is widely used for JavaScript package management. This package has been identified as part of a malicious campaign that floods the npm registry with derivative packages designed to inflate developer reputation scores for token rewards. The malicious nature of this package lies in its ability to modify critical files and continuously republish variants, thereby polluting the npm registry.
Vulnerability Detail
The vulnerability in 'samehada-hzos-rc7' originates from its involvement in the tea.xyz token reward campaign. It contains scripts that automatically generate and publish derivative packages with randomized names. The malicious payload alters the package.json file by removing private flags, changing version numbers, and creating random package names, which can lead to significant pollution of the npm registry and potential security risks for developers using these packages.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall samehada-hzos-rc7
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 avoid using the 'samehada-hzos-rc7' package and look for alternative packages that provide similar functionality without the associated risks. Additionally, consider using tools like Vulert to monitor your project for vulnerabilities. You can check if your application is affected by this vulnerability using the Vulert playground at https://vulert.com/scanner.
Conclusion
The 'samehada-hzos-rc7' package poses a significant risk due to its malicious code designed to manipulate the npm registry. It is crucial for developers to remove this package from their projects and monitor for similar vulnerabilities using tools like Vulert. Staying informed and proactive can help maintain the integrity of your software.
See every vulnerability recorded for samehada-hzos-rc7 →
FAQ
It is an npm package that has been identified as part of a malicious campaign to inflate developer reputation scores through automated publishing of derivative packages.
The vulnerability can lead to the pollution of the npm registry, potentially introducing malicious code into your project and affecting its integrity.
You should uninstall the package immediately and check for any dependencies that may rely on it. Consider using alternative packages.
You can use tools like Vulert, which monitors your package-lock.json file 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 any signup.