Malicious Code Detected in x402-legacy Package - Version 3.0.0
Summary
MAL-2025-191485: Malicious code in x402-legacy (npm). Affects x402-legacy versions 3.0.0. 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 x402-legacy package is an npm library that is utilized for various functionalities within JavaScript applications. It is designed to provide developers with tools and features that enhance their coding experience. However, version 3.0.0 of this package has been identified as malicious, posing significant risks to applications that incorporate it.
Vulnerability Detail
The vulnerability in the x402-legacy package arises from its ability to communicate with a domain linked to malicious activities. Additionally, it executes commands that are associated with harmful behavior, potentially compromising the security of applications that use this package. This vulnerability was identified by the OpenSSF Package Analysis project, which flagged the package as malicious due to its actions.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall x402-legacy
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 remove the x402-legacy package from your project until a secure version is released. Use the following command to uninstall it: npm uninstall x402-legacy.
Conclusion
The x402-legacy package version 3.0.0 has been identified as malicious, posing risks to applications that utilize it. It is crucial to update or remove the package to protect your application from potential threats. Utilize tools like Vulert to monitor for vulnerabilities in your software.
See every vulnerability recorded for x402-legacy →
FAQ
x402-legacy is an npm package used in JavaScript applications for various functionalities. However, version 3.0.0 has been flagged as malicious.
The vulnerability allows the package to communicate with malicious domains and execute harmful commands, which can compromise your application's security.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected by this vulnerability.
It is advisable to check for a patched version of the x402-legacy package in the npm registry and update to that version.
As a temporary measure, you can uninstall the x402-legacy package from your project to mitigate the risk until a secure version is available.