CVE-2025-9162
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- High
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
4.9
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.
- Record
CVE-2025-9162- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-526
- Updated
- 2026-11-02
EUVDEUVD-2025-25456
4.9
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.
- Record
EUVD-2025-25456- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-8hxp-qmph-w5gq
4.9
Keycloak Potential Variable Reference in Model Storage Services
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.
- Record
GHSA-8hxp-qmph-w5gq- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-526
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-w2wj-hw98-233h
4.9
Duplicate Advisory: Keycloak Potential Variable Reference in Model Storage Services
Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-8hxp-qmph-w5gq. This link is maintained to preserve external references.
Original 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.
- Record
GHSA-w2wj-hw98-233h- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-526
- Updated
- 2026-11-02
NVD
4.9
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.
- Record
CVE-2025-9162- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-526
- Updated
- 2026-11-02
OSV
4.9
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.
- Record
CVE-2025-9162- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-526
- Updated
- 2026-11-02
OSVGHSA-8hxp-qmph-w5gq
4.9
Keycloak Potential Variable Reference in Model Storage Services
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.
- Record
GHSA-8hxp-qmph-w5gq- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-526
- Updated
- 2026-11-02
OSVGHSA-w2wj-hw98-233h
4.9
Duplicate Advisory: Keycloak Potential Variable Reference in Model Storage Services
Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-8hxp-qmph-w5gq. This link is maintained to preserve external references.
Original 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.
- Record
GHSA-w2wj-hw98-233h- CVSS 3.1
- 4.9 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-526
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
org.keycloak:keycloak-model-storage-servicesMaven |
before 26.2.9 | 26.2.9 |
org.keycloak:keycloak-model-storage-servicesMaven |
26.3.0 up to 26.3.4 | 26.3.4 |
org.keycloak:keycloak-model-storage-servicesMaven |
All versions, plus listed versions 24.0.024.0.124.0.224.0.324.0.4 Show 45 moreShow less24.0.525.0.025.0.125.0.225.0.425.0.525.0.626.0.026.0.126.0.226.0.326.0.426.0.526.0.626.0.726.0.826.1.026.1.126.1.226.1.326.1.426.1.526.2.026.2.126.2.226.2.326.2.426.2.526.3.026.3.126.3.226.3.326.3.426.3.526.4.026.4.126.4.226.4.326.4.426.4.526.4.626.4.726.5.026.5.126.5.2 |
None known |
org.keycloak:keycloak-model-storage-servicesMaven |
26.3.0 up to 26.3.4, plus listed versions 26.3.126.3.226.3.3 |
26.3.4 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-9162 is a medium vulnerability (CVSS 4.9) in Keycloak, published August 21, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.54%, the 45th percentile. Fixed in org.keycloak:keycloak-model-storage-services 26.2.9.
References
access.redhat.com/errata/RHSA-2025:15336
access.redhat.com/errata/RHSA-2025:15337
access.redhat.com/errata/RHSA-2025:15338
access.redhat.com/errata/RHSA-2025:15339
access.redhat.com/errata/RHSA-2025:16399
access.redhat.com/errata/RHSA-2025:16400
Show 12 moreShow less
access.redhat.com/security/cve/CVE-2025-9162
bugzilla.redhat.com/show_bug.cgi?id=2389396
github.com/keycloak/keycloak/security/advisories/GHSA-8hxp-qmph-w5gq
github.com/keycloak/keycloak/blob/26.3.3/model/storage-services/src/main/java/org/keycloak/exportimport/AbstractFileBasedImportProvider.java
github.com/keycloak/keycloak/blob/75afda410495a9576e00edc3277ab42ca155f806/model/storage-services/src/main/java/org/keycloak/exportimport/AbstractFileBasedImportProvider.java
github.com/advisories/GHSA-8hxp-qmph-w5gq
nvd.nist.gov/vuln/detail/CVE-2025-9162
github.com/advisories/GHSA-w2wj-hw98-233h
access.redhat.com/downloads/content/package-browser
catalog.redhat.com/software/containers
github.com/CVEProject/cvelistV5/tree/main/cves/2025/9xxx/CVE-2025-9162.json
github.com/keycloak/keycloak
Left out here: 14 versions. The JSON record has them.