Critical Malicious Code Vulnerability in kns-error-code Package
Summary
MAL-2025-191120: Malicious code in kns-error-code (npm). Affects kns-error-code versions 1.0.8. 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 kns-error-code package is an npm library designed for handling error codes in applications. It is utilized by developers to streamline error management and improve debugging processes. However, this package has been compromised, embedding malicious code that poses significant security risks to any system using it.
Vulnerability Detail
The vulnerability stems from the presence of embedded malicious code within the kns-error-code package, identified as version 1.0.8. This code can fully compromise any computer where the package is installed, allowing unauthorized access to sensitive information such as secrets and keys. The origin of this vulnerability is linked to a malicious actor who has manipulated the package, making it crucial for users to take immediate action to protect their systems.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall kns-error-code
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
Currently, there are no effective workarounds to mitigate the risks associated with the kns-error-code package. The best course of action is to uninstall the package and monitor your system for any unusual activity.
Conclusion
The kns-error-code package has been compromised with malicious code, posing serious security risks to any system using it. Immediate action is required to uninstall the package and secure sensitive information. Users are encouraged to utilize tools like Vulert for ongoing monitoring of vulnerabilities in their applications.
See every vulnerability recorded for kns-error-code →
FAQ
The kns-error-code package is an npm library used for managing error codes in applications, aiding developers in error handling and debugging.
The malicious code can fully compromise your system, allowing unauthorized access to sensitive information and potentially leading to data breaches.
You should immediately uninstall the kns-error-code package and rotate any sensitive information stored on the affected system.
No, there is currently no patched version of the kns-error-code package available. The only solution is to remove the package.
You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities using just your package-lock.json file. You can also check your application for this specific vulnerability using the Vulert playground at Vulert Scanner without any signup.