CVE-2025-9162 — keycloak-model-storage-se…
MEDIUMCVE-2025-9162 is a medium-severity (CVSS 4.9) CWE-526 vulnerability in org.keycloak:keycloak-model-storage-services. A fix is available for org.keycloak:keycloak-model-storage-services — see the affected versions and patch details below.
Org.keycloak/keycloak-model-storage-service: variable injection into environment variables
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-9162.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
org.keycloak:keycloak-model-storage-services☕org.keycloak:keycloak-model-storage-servicesReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
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
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.keycloak:keycloak-model-storage-services | all versions | No fix |
| ☕Maven | org.keycloak:keycloak-model-storage-services | ≥ 26.3.0&&< 26.3.4 | 26.3.4org.keycloak:keycloak-model-storage-services:26.3.4 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.keycloak:keycloak-model-storage-services, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
A fix is available for CVE-2025-9162; check the affected-versions list above or the advisory for the patched release of org.keycloak:keycloak-model-storage-services, then make sure no transitive dependency still pins the vulnerable range.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.Source: Red Hat security advisory for CVE-2025-9162 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat build of Keycloak 26.0 | org.keycloak/keycloak-model-storage-service | RHSA-2025:15336 |
| Red Hat build of Keycloak 26.0 | rhbk/keycloak-operator-bundle:26.0.15-1 | RHSA-2025:15337 |
| Red Hat build of Keycloak 26.2 | org.keycloak/keycloak-model-storage-service | RHSA-2025:15339 |
| Red Hat build of Keycloak 26.2 | rhbk/keycloak-operator-bundle:26.2.8-1 | RHSA-2025:15338 |
| Red Hat build of Keycloak 26.2 | rhbk/keycloak-operator-bundle:26.2.9-1 | RHSA-2025:16400 |
| Red Hat build of Keycloak 26.2.9 | org.keycloak/keycloak-model-storage-service | RHSA-2025:16399 |
Frequently Asked Questions
Is CVE-2025-9162 in your dependencies?
Find it across Maven, including transitive dependencies.