Critical Malicious Code Vulnerability in react-keycloak-context Package
Summary
MAL-2025-190992: Malicious code in react-keycloak-context (npm). Affects react-keycloak-context versions 1.0.8 – 1.0.9. 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 react-keycloak-context package is a library designed for integrating Keycloak authentication with React applications. It provides developers with tools to manage user sessions and secure applications easily. However, recent findings have revealed that this package contains malicious code that compromises the security of any system using it.
Vulnerability Detail
The vulnerability originates from the inclusion of malicious code within the react-keycloak-context package. This code can lead to full system compromise, allowing unauthorized access to sensitive information such as secrets and keys. The malicious nature of the code has been confirmed by multiple sources, including Amazon Inspector and GHSA malware reports, indicating that any system running this package should be considered at risk.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall react-keycloak-context
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 react-keycloak-context package until a secure version is released. Additionally, consider using alternative libraries for Keycloak integration that do not have known vulnerabilities.
Conclusion
The react-keycloak-context package has been identified as containing malicious code that poses significant security risks. It is essential for developers to remove the affected versions and monitor their applications for vulnerabilities to maintain security integrity.
See every vulnerability recorded for react-keycloak-context →
FAQ
It is a library for integrating Keycloak authentication into React applications, providing session management and security features.
You can check your application's dependencies using the Vulert playground at Vulert Scanner, which monitors vulnerabilities in real-time.
Immediately remove the affected versions (1.0.8 and 1.0.9) and replace them with a secure alternative or wait for a patched version.
Failing to address this vulnerability can lead to unauthorized access to sensitive data and complete system compromise.
Yes, you can use Vulert, which monitors your package-lock.json file to alert you of any open-source vulnerabilities in real-time.