Malicious Code Injection in ruji-31: A Threat to npm Packages
Summary
MAL-2025-165257: Malicious code in ruji-31 (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 'ruji-31' is part of the npm ecosystem and is associated with the tea.xyz token reward campaign. This campaign has been known to flood the npm registry with packages that contain scripts designed to manipulate package metadata and inflate developer reputation scores. The primary functionality of these packages is to automate the generation and publication of derivative packages, which can lead to significant pollution of the npm registry.
Vulnerability Detail
The vulnerability in 'ruji-31' originates from its inclusion in a malicious campaign that modifies the package.json file to remove private flags, alters version numbers, and generates random package names. This behavior not only compromises the integrity of the affected package but also poses a risk to the broader npm ecosystem by flooding it with potentially harmful and untrustworthy packages. The malicious payload continuously republishes variants, making it difficult for developers to identify and remove these threats.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall ruji-31
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 measure, you can remove the 'ruji-31' package from your project by executing the following command: 'npm uninstall ruji-31'. This will prevent any malicious code from executing until a proper fix is applied.
Conclusion
The 'ruji-31' package poses a significant threat due to its malicious code that alters package metadata and floods the npm registry. It is essential to take immediate action by updating or removing the package to safeguard your application and the broader ecosystem.
See every vulnerability recorded for ruji-31 →
FAQ
The main issue is that it contains malicious code that modifies package metadata and floods the npm registry with untrustworthy packages.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without any signup.
You should uninstall the package immediately and check for any updates or patches that may be available.
Regularly updating your dependencies and using tools like Vulert to monitor for vulnerabilities can help prevent such issues.
Failing to address this vulnerability can lead to compromised application integrity, exposure to malicious code, and potential damage to your project's reputation.