Critical Malicious Code Vulnerability in xml2js-js Package
Summary
MAL-2026-234: Malicious code in xml2js-js (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 xml2js-js package is a popular JavaScript library used for parsing XML into JavaScript objects and vice versa. It is widely utilized in Node.js applications for its ease of use and flexibility. However, recent findings have revealed that this package contains malicious code, posing a significant security risk to any system that has it installed.
Vulnerability Detail
The vulnerability stems from the presence of embedded malicious code within the xml2js-js package. This code can compromise the integrity of the system, allowing unauthorized access to sensitive information such as secrets and keys. Any computer running this package should be considered fully compromised, as the malicious code may grant an outside entity complete control over the system. The origin of this issue is linked to the package being flagged as malicious by security researchers, highlighting the importance of scrutinizing third-party dependencies.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall xml2js-js
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 workaround, you can replace the xml2js-js package with a different XML parsing library that does not have known vulnerabilities. Some alternatives include 'xml2js' or 'fast-xml-parser'. You can install one of these alternatives using npm, for example: npm install xml2js.
Conclusion
The xml2js-js package has been identified as containing malicious code, posing a serious threat to systems that utilize it. Immediate action is required to remove the package and secure any sensitive information. Users are encouraged to explore alternative libraries and utilize tools like Vulert for ongoing monitoring of their dependencies.
See every vulnerability recorded for xml2js-js →
FAQ
You should immediately uninstall the xml2js-js package and rotate any sensitive information stored on the affected system.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
Currently, there is no patched version available for the xml2js-js package. It is recommended to remove it and use alternative libraries.
Failing to address this vulnerability can lead to unauthorized access to sensitive data and complete control of your system by malicious actors.
You can use tools like Vulert, which monitors and alerts in real-time for open-source vulnerabilities using just your package-lock.json file.