Critical Malicious Code Vulnerability in dark-switch Package
Summary
MAL-2025-5907: Malicious code in dark-switch (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 dark-switch package is an npm library designed for toggling dark mode in web applications. It is widely used due to its simplicity and ease of integration. However, it has been identified to contain malicious code that compromises the security of any system it is installed on, making it a significant risk for developers and users alike.
Vulnerability Detail
The vulnerability originates from embedded malicious code within the dark-switch package. This code can fully compromise any computer that has the package installed, allowing unauthorized access to sensitive information such as secrets and keys. The ramifications of this vulnerability are severe, as it can lead to data breaches and loss of control over the affected systems. Users are advised to treat any system running this package as compromised.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall dark-switch
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
There are no effective workarounds for this vulnerability. The only safe course of action is to uninstall the dark-switch package and secure your environment.
Conclusion
The dark-switch package has been identified as containing malicious code that poses a significant risk to any system it is installed on. Immediate action is required to uninstall the package and secure any compromised systems. Utilizing tools like Vulert can help in monitoring for such vulnerabilities in the future.
See every vulnerability recorded for dark-switch →
FAQ
Immediately uninstall the dark-switch package and rotate any sensitive information stored on the affected system.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without any signup.
There are no mitigation strategies available. The only solution is to uninstall the package.
Failure to address this vulnerability can lead to unauthorized access to sensitive data, data breaches, and loss of control over your systems.
While many npm packages are safe, it is essential to conduct thorough reviews and use tools like Vulert to monitor for vulnerabilities in your dependencies.