CVE-2025-1391: Keycloak-services: improper authorization in keycloak organization mapper allows unauthorized organization claims

Published Feb 17, 2025
·
Updated

Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-gvgg-2r3r-53x7. This link is maintained to preserve external references.

Original Description A flaw was found in the Keycloak organization feature, which allows the incorrect assignment of an organization to a user if their username or email matches the organization’s domain pattern. This issue occurs at the mapper level, leading to misrepresentation in tokens. If an application relies on these claims for authorization, it may incorrectly assume a user belongs to an organization they are not a member of, potentially granting unauthorized access or privileges.

Other sources

This vulnerability is caused by the improper mapping of users to organizations based solely on email/username patterns. The issue is limited to the token claim level, meaning the user is not truly added to the organization but may appear as such in applications relying on these claims. The risk increases in scenarios where self-registration is enabled and unrestricted, allowing an attacker to exploit the naming pattern. The issue is mitigated if admins restrict registration or use strict validation mechanisms.

— GitHub

Affected Software

4 affected componentsFixes available
maven/org.keycloak:keycloak-services<26.0.10
26.0.10
maven/org.keycloak:keycloak-services>=26.1.0<26.1.3
26.1.3
maven/org.keycloak:keycloak-services<26.1.2
26.1.2
Red Hat Keycloak

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/org.keycloak:keycloak-services to a version that resolves this vulnerability.

    Fixed in 26.0.10
  2. Upgrade

    Upgrade maven/org.keycloak:keycloak-services to a version that resolves this vulnerability.

    Fixed in 26.1.3
  3. Upgrade

    Upgrade maven/org.keycloak:keycloak-services to a version that resolves this vulnerability.

    Fixed in 26.1.2
  4. Compensating control

    Mitigate the Keycloak organization mapper improper authorization risk by restricting registration (especially when self-registration is enabled) or using strict validation mechanisms so attackers cannot exploit email/username-to-organization domain pattern mappings.

Event History

Feb 17, 2025
Data Sourced
via Red Hat·08:58 AM
DescriptionSeverityAffected Software
CVE Published
via MITRE·02:01 PM
Data Sourced
via MITRE·02:01 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:15 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·03:32 PM
Mar 10, 2025
Withdrawn
via GitHub·09:07 PM

Frequently Asked Questions

1

What is the severity of CVE-2025-1391?

CVE-2025-1391 is classified as a medium severity vulnerability due to its potential impact on user organization assignments in Keycloak.

2

How do I fix CVE-2025-1391?

To fix CVE-2025-1391, update Red Hat Keycloak to the latest version that addresses this vulnerability.

3

What are the implications of CVE-2025-1391 for users?

CVE-2025-1391 can lead to improper organization assignments, which may result in incorrect access control and user permissions.

4

Which software versions are affected by CVE-2025-1391?

CVE-2025-1391 affects the Red Hat Build of Keycloak, specifically versions prior to the fix.

5

What is the root cause of CVE-2025-1391?

The root cause of CVE-2025-1391 is a flaw at the mapper level in Keycloak that allows incorrect organization assignment based on matching username or email patterns.

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