Keycloak Model Storage Service Variable Injection Vulnerability

Vulnerability

A vulnerability exists in the Keycloak Model Storage Service, specifically within the KeycloakRealmImport custom resource. This issue arises because the import process replaces placeholders in realm documents, which can potentially reference environment variables. Such substitution creates an opportunity for injection attacks, allowing malicious content to be introduced during the realm import. As a result, sensitive environment variables, like the database password, could be compromised, leading to unintended consequences in the Keycloak environment.

Impact

Exploitation of this vulnerability could result in the injection of malicious content into the Keycloak environment, potentially allowing access to sensitive information stored in environment variables, such as database passwords.

Reproduction

To reproduce this vulnerability, import a crafted realm document that includes placeholders referencing sensitive environment variables. During the import process, the KeycloakRealmImport custom resource will replace the placeholders with the actual variable values, injecting the referenced content into the Keycloak environment.

Added: Aug 21, 2025, 4:20 PM
Updated: Aug 21, 2025, 4:20 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
0.6
exploitability
6.1
remediation
0.0
relevance
0.4
threat
6.4
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.