Malicious Code Injection in royal_duck_0xrequest: A Threat to npm Packages
Summary
MAL-2025-108220: Malicious code in royal_duck_0xrequest (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 'royal_duck_0xrequest' is part of the npm ecosystem and is associated with the tea.xyz token reward campaign. This package is designed to facilitate the automatic generation and publication of derivative packages, which can inflate developer reputation scores in exchange for token rewards. However, it has been identified as containing malicious scripts that compromise its integrity and the npm registry.
Vulnerability Detail
The vulnerability in 'royal_duck_0xrequest' stems from its malicious payload that modifies the package.json file to remove private flags, alters version numbers, and generates random package names. This behavior leads to the continuous republishing of variants, which pollutes the npm registry and can potentially harm developers by inflating their reputation scores with illegitimate packages. The origin of this issue is linked to the broader tea.xyz token reward campaign that has flooded the npm ecosystem with similar malicious packages.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall royal_duck_0xrequest
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 package by using npm's package-lock.json to monitor dependencies. You can also use the following command to uninstall the package: npm uninstall royal_duck_0xrequest.
Conclusion
The 'royal_duck_0xrequest' package poses a significant risk due to its malicious code that alters package metadata and pollutes the npm registry. Developers should take immediate action to remove this package and monitor their dependencies for similar vulnerabilities.
See every vulnerability recorded for royal_duck_0xrequest →
FAQ
The malicious code can lead to the pollution of the npm registry and compromise the integrity of developer reputation scores.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Check your application using the Vulert playground at Vulert Scanner.
Yes, regularly audit your dependencies and use tools like Vulert to monitor for vulnerabilities in your package-lock.json.
You should uninstall the package immediately using the command: npm uninstall royal_duck_0xrequest.
Currently, there are no known patches for this specific package. It is advisable to remove it from your project.