CVE-2025-9162: Org.keycloak/keycloak-model-storage-service: variable injection into environment variables

Published Aug 19, 2025
·
Updated

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.

Other sources

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

There is a potential security issue with the KeycloakRealmImport custom resource. Placeholders within the realm document, which may reference environment variables, will be replaced as part of the import process. That provides a way to inject into the realm sensitive environment variables, such as the database password. See https://github.com/keycloak/keycloak/blob/75afda410495a9576e00edc3277ab42ca155f806/model/storage-services/src/main/java/org/keycloak/exportimport/AbstractFileBasedImportProvider.java#L35

Red Hat

Affected Software

4 affected componentsFixes available
Keycloak keycloak-model-storage-service
maven/org.keycloak:keycloak-model-storage-services<=26.3.3
maven/org.keycloak:keycloak-model-storage-services<26.2.9
maven/org.keycloak:keycloak-model-storage-services>=26.3.0<26.3.4
26.3.4

Event History

Aug 19, 2025
Data Sourced
via Red Hat·01:11 PM
DescriptionSeverityAffected Software
Aug 21, 2025
CVE Published
via MITRE·03:40 PM
Data Sourced
via MITRE·03:40 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:15 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·06:31 PM
Data Sourced
via GitHub·06:31 PM
DescriptionSeverityWeaknessAffected Software
Oct 8, 2025
Updated
via GitHub·11:32 PM
DescriptionAffected Software
Feb 27, 57989
Event
via FIRST·06:51 PM

Frequently Asked Questions

1

What is the severity of CVE-2025-9162?

CVE-2025-9162 is classified as a medium severity vulnerability due to the potential for injection attacks.

2

How do I fix CVE-2025-9162?

To fix CVE-2025-9162, update your Keycloak installation to the latest version that addresses this vulnerability.

3

What versions of the keycloak-model-storage-service are affected by CVE-2025-9162?

CVE-2025-9162 affects all versions of keycloak-model-storage-service that allow realm document placeholders to be substituted.

4

What type of vulnerability is CVE-2025-9162?

CVE-2025-9162 is a code injection vulnerability that can lead to unauthorized command execution when improperly handled.

5

Where can I find more information about CVE-2025-9162?

More information about CVE-2025-9162 can be found in the official CVE database or security advisories related to Keycloak.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203