Vulnerability · Published Aug 21, 2025 · Assigned by redhat
CVE-2025-9162Org.keycloak/keycloak-model-storage-service: variable injection into environment variables
Medium 4.9
In plain English
A medium-severity security flaw in keycloak from Keycloak. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 45% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Maven | org.keycloak:keycloak-model-storage-services | no fix listed | GHSA-8hxp-qmph-w5gq |
| Maven | org.keycloak:keycloak-model-storage-services | 26.3.4 | GHSA-8hxp-qmph-w5gq |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Keycloak | keycloak | 0 – before 26.3.4 |
| Red Hat | Red Hat build of Keycloak 26.0 | see references |
| Red Hat | Red Hat build of Keycloak 26.0 | see references |
| Red Hat | Red Hat build of Keycloak 26.0 | see references |
| Red Hat | Red Hat build of Keycloak 26.0 | see references |
| Red Hat | Red Hat build of Keycloak 26.2 | see references |
| Red Hat | Red Hat build of Keycloak 26.2 | see references |
| Red Hat | Red Hat build of Keycloak 26.2 | see references |
| Red Hat | Red Hat build of Keycloak 26.2 | see references |
| Red Hat | Red Hat build of Keycloak 26.2 | see references |
| Red Hat | Red Hat build of Keycloak 26.2 | see references |
| Red Hat | Red Hat build of Keycloak 26.2 | see references |
| Red Hat | Red Hat build of Keycloak 26.2.9 | see references |
Weakness: CWE-526 · Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
References
- RHSA-2025:15336 vendor-advisory, x_refsource_REDHAT
- RHSA-2025:15337 vendor-advisory, x_refsource_REDHAT
- RHSA-2025:15338 vendor-advisory, x_refsource_REDHAT
- RHSA-2025:15339 vendor-advisory, x_refsource_REDHAT
- RHSA-2025:16399 vendor-advisory, x_refsource_REDHAT
- RHSA-2025:16400 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2025-9162 vdb-entry, x_refsource_REDHAT
- RHBZ#2389396 issue-tracking, x_refsource_REDHAT