Malicious Code Injection in cosmicadventurer: A Threat to npm Packages
Summary
MAL-2025-171069: Malicious code in cosmicadventurer (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 cosmicadventurer package is part of the npm ecosystem, which is widely used for JavaScript development. This package, like many others, is intended to facilitate various functionalities within applications. However, it has been identified as part of a malicious campaign that exploits npm's package management system, leading to significant security concerns.
Vulnerability Detail
The vulnerability stems from a malicious code injection within the cosmicadventurer package, linked to a broader campaign that aims to manipulate npm's registry. The package contains scripts that automatically modify its own package.json file to remove private flags, alter version numbers, and generate numerous derivative packages with random names. This not only inflates developer reputation scores for token rewards but also pollutes the npm registry, potentially leading to further exploitation and security risks for users who inadvertently install these malicious packages.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall cosmicadventurer
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 measure, you can avoid using the cosmicadventurer package and instead look for alternative packages that provide similar functionality without the associated risks. Always verify the integrity and reputation of packages before installation.
Conclusion
The cosmicadventurer package has been identified as a vector for malicious code injection, posing significant risks to applications using it. It is crucial for developers to be vigilant, regularly update their dependencies, and utilize tools like Vulert to monitor for vulnerabilities. By taking proactive measures, developers can safeguard their applications from potential threats.
See every vulnerability recorded for cosmicadventurer →
FAQ
The cosmicadventurer package is an npm package used in JavaScript development, but it has been compromised with malicious code.
The vulnerability can lead to the installation of malicious scripts that may compromise your application's integrity and security.
You should uninstall the cosmicadventurer package immediately using the command npm uninstall cosmicadventurer.
You can use tools like Vulert, which monitors your package-lock.json file for vulnerabilities in real-time without requiring code access.
Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.