Malicious Code Injection in astro-xo-dotenv-parse-variables-xml Package
Summary
MAL-2025-139620: Malicious code in astro-xo-dotenv-parse-variables-xml (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 astro-xo-dotenv-parse-variables-xml package is part of the npm ecosystem and is designed to parse environment variables from XML files. It is typically used in JavaScript applications to manage configuration settings. However, this package has been compromised, making it susceptible to malicious activities that can affect the integrity of applications relying on it.
Vulnerability Detail
The vulnerability originates from a malicious payload embedded within the astro-xo-dotenv-parse-variables-xml package. This payload modifies the package.json file by removing private flags, altering version numbers, and generating random package names to inflate developer reputation scores. The malicious scripts are designed to continuously republish variants of the package, polluting the npm registry and potentially leading to security breaches in applications that utilize this package.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall astro-xo-dotenv-parse-variables-xml
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, consider removing the astro-xo-dotenv-parse-variables-xml package from your project until a secure version is available. You can do this by running: npm uninstall astro-xo-dotenv-parse-variables-xml.
Conclusion
The astro-xo-dotenv-parse-variables-xml package has been compromised, leading to significant security vulnerabilities. It is crucial to update or remove the package to protect your applications from potential threats. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for astro-xo-dotenv-parse-variables-xml →
FAQ
The vulnerability can lead to unauthorized modifications of your package.json file, potentially compromising the security and functionality of your application.
You can use Vulert, which monitors open-source vulnerabilities in real-time. By analyzing your package-lock.json file, Vulert can alert you to any vulnerabilities, including this one.
Regularly audit your dependencies and use tools like Vulert to monitor for vulnerabilities. Additionally, avoid using packages from untrusted sources.
If an immediate update is not possible, consider removing the package or replacing it with a more secure alternative until a fix is available.
Detailed information about this vulnerability can be found on the GitHub repository for malicious packages, as well as through security advisories related to npm packages.