Critical Malicious Code Vulnerability in cosmic-dev-server Package
Summary
MAL-2025-17604: Malicious code in cosmic-dev-server (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 cosmic-dev-server package is a Node.js server designed for development purposes, providing a simple way to serve static files and facilitate local development environments. It is commonly used in web development projects for its ease of use and rapid setup. However, recent findings have revealed that this package contains malicious code, posing significant security risks to applications that utilize it.
Vulnerability Detail
The vulnerability in the cosmic-dev-server package originates from the inclusion of malicious code that can compromise the security of applications using this package. This code may lead to unauthorized access, data breaches, or other malicious activities, potentially affecting the integrity and confidentiality of user data. The vulnerability is present from version 0 and has been identified as a serious threat that requires immediate attention from developers and users of the package.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall cosmic-dev-server
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 cosmic-dev-server package from your project and using an alternative development server that does not have known vulnerabilities. You can also manually review the package's code to identify and mitigate the malicious components, although this approach is not recommended due to the complexity involved.
Conclusion
The discovery of malicious code in the cosmic-dev-server package poses a significant risk to developers and users. Immediate action is required to update or replace the package to safeguard applications from potential threats. Utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.
See every vulnerability recorded for cosmic-dev-server →
FAQ
The cosmic-dev-server package is a Node.js server used for serving static files during development, allowing developers to quickly set up a local environment.
The malicious code can lead to unauthorized access, data breaches, and other security issues, compromising the integrity of your application and user data.
You can use Vulert, which monitors and alerts for open-source vulnerabilities using just your package-lock.json file. You can check your application at the Vulert playground without any signup.
If an immediate update is not possible, consider removing the package and using an alternative development server until a fix is available.
More information can be found on the GitHub page for the cosmic-dev-server package and through security advisories related to npm packages.