Bug 2346082 (CVE-2025-1391)

Summary: CVE-2025-1391 keycloak-services: Improper Authorization in Keycloak Organization Mapper Allows Unauthorized Organization Claims
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: boliveir, drichtar, jkoops, pdrozd, peholase, pesilva, pjindal, pskopek, rmartinc, rowaters, sthorger
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description OSIDB Bzimport 2025-02-17 08:58:22 UTC
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.

Comment 1 errata-xmlrpc 2025-03-10 18:02:58 UTC
This issue has been addressed in the following products:

  Red Hat build of Keycloak 22

Via RHSA-2025:2545 https://access.redhat.com/errata/RHSA-2025:2545

Comment 2 errata-xmlrpc 2025-03-10 18:17:44 UTC
This issue has been addressed in the following products:

  Red Hat build of Keycloak 26.0

Via RHSA-2025:2544 https://access.redhat.com/errata/RHSA-2025:2544