Keycloak ModStor Service: EnvVar Injection via Realm Import
CVE-2025-9162 Published on August 21, 2025

Org.keycloak/keycloak-model-storage-service: variable injection into environment variables
A flaw was found in org.keycloak/keycloak-model-storage-service. The KeycloakRealmImport custom resource substitutes placeholders within imported realm documents, potentially referencing environment variables. This substitution process allows for injection attacks when crafted realm documents are processed. An attacker can leverage this to inject malicious content during the realm import procedure. This can lead to unintended consequences within the Keycloak environment.

Github Repository Vendor Advisory Vendor Advisory Vendor Advisory Vendor Advisory Vendor Advisory Vendor Advisory NVD

Vulnerability Analysis

CVE-2025-9162 is exploitable with network access, and requires user privileges. This vulnerability is considered to have a low attack complexity. The potential impact of an exploit of this vulnerability is considered to have a high impact on confidentiality, with no impact on integrity and availability.

Attack Vector:
NETWORK
Attack Complexity:
LOW
Privileges Required:
HIGH
User Interaction:
NONE
Scope:
UNCHANGED
Confidentiality Impact:
HIGH
Integrity Impact:
NONE
Availability Impact:
NONE

Timeline

Reported to Red Hat.

Made public.

Weakness Type

Exposure of Sensitive Information Through Environmental Variables

Environmental variables may contain sensitive information about a remote server.


Products Associated with CVE-2025-9162

Want to know whenever a new CVE is published for Red Hat Build Keycloak? stack.watch will email you.

 

Affected Versions

keycloak: Red Hat build of Keycloak 26.0: Red Hat build of Keycloak 26.0: Red Hat build of Keycloak 26.0: Red Hat build of Keycloak 26.0: Red Hat build of Keycloak 26.2: Red Hat build of Keycloak 26.2: Red Hat build of Keycloak 26.2: Red Hat build of Keycloak 26.2: Red Hat build of Keycloak 26.2: Red Hat build of Keycloak 26.2: Red Hat build of Keycloak 26.2: Red Hat build of Keycloak 26.2.9:

Vulnerable Packages

The following package name and versions may be associated with CVE-2025-9162

Package Manager Vulnerable Package Versions Fixed In
maven org.keycloak:keycloak-model-storage-services < 26.2.9 26.2.9
maven org.keycloak:keycloak-model-storage-services >= 26.3.0, < 26.3.4 26.3.4

Exploit Probability

EPSS
0.02%
Percentile
5.83%

EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.