CVE-2025-1391: Improper Access Control
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.
AI Analysis
Technical Summary
CVE-2025-1391 is an improper access control vulnerability identified in Keycloak version 26.0.0, specifically affecting the organization feature's mapper logic. Keycloak uses mappers to assign claims to tokens based on user attributes. This vulnerability arises because the mapper incorrectly assigns an organization to a user if the user's username or email matches the organization's domain pattern. This logic flaw causes the token to contain claims indicating membership in an organization the user does not actually belong to. Applications relying on these claims for authorization decisions may mistakenly grant elevated privileges or access to unauthorized users. The vulnerability is exploitable remotely without user interaction and requires only low privileges (authenticated user). The CVSS 3.1 base score is 5.4 (medium severity), reflecting limited confidentiality and integrity impact but no availability impact. No patches or known exploits are currently reported, but the flaw poses a risk in environments where Keycloak is used as a central identity provider and authorization source. The issue highlights the importance of validating claims and not solely trusting token contents without additional verification.
Potential Impact
The primary impact of CVE-2025-1391 is unauthorized access or privilege escalation within applications that rely on Keycloak's organization claims for authorization. Attackers can gain access to resources, data, or functions reserved for members of specific organizations by exploiting the flawed mapper logic. This can lead to data leakage, unauthorized actions, or compromise of organizational boundaries within multi-tenant or enterprise environments. Since Keycloak is widely used for identity and access management in cloud-native and enterprise applications, the vulnerability could affect numerous organizations globally. The impact is particularly significant for organizations with strict access controls based on organizational membership, such as financial institutions, healthcare providers, and large enterprises. However, the vulnerability does not affect system availability and requires an attacker to have at least low-level authenticated access, limiting the scope somewhat.
Mitigation Recommendations
To mitigate CVE-2025-1391, organizations should first upgrade Keycloak to a version where this vulnerability is patched once available. Until a patch is released, administrators should review and tighten the configuration of organization mappers, avoiding reliance solely on username or email domain pattern matching for organization assignment. Implement additional authorization checks within applications that do not trust token claims blindly; for example, verify organization membership against a backend authoritative source. Employ strict monitoring and logging of authentication and authorization events to detect anomalous access patterns. Limit the exposure of Keycloak endpoints to trusted networks and enforce strong authentication policies to reduce the risk of low-privilege user exploitation. Finally, conduct thorough security assessments of identity and access management workflows to ensure no other similar logic flaws exist.
Affected Countries
United States, Germany, United Kingdom, France, India, Japan, Canada, Australia, Netherlands, Brazil, South Korea
CVE-2025-1391: Improper Access Control
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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2025-1391 is an improper access control vulnerability identified in Keycloak version 26.0.0, specifically affecting the organization feature's mapper logic. Keycloak uses mappers to assign claims to tokens based on user attributes. This vulnerability arises because the mapper incorrectly assigns an organization to a user if the user's username or email matches the organization's domain pattern. This logic flaw causes the token to contain claims indicating membership in an organization the user does not actually belong to. Applications relying on these claims for authorization decisions may mistakenly grant elevated privileges or access to unauthorized users. The vulnerability is exploitable remotely without user interaction and requires only low privileges (authenticated user). The CVSS 3.1 base score is 5.4 (medium severity), reflecting limited confidentiality and integrity impact but no availability impact. No patches or known exploits are currently reported, but the flaw poses a risk in environments where Keycloak is used as a central identity provider and authorization source. The issue highlights the importance of validating claims and not solely trusting token contents without additional verification.
Potential Impact
The primary impact of CVE-2025-1391 is unauthorized access or privilege escalation within applications that rely on Keycloak's organization claims for authorization. Attackers can gain access to resources, data, or functions reserved for members of specific organizations by exploiting the flawed mapper logic. This can lead to data leakage, unauthorized actions, or compromise of organizational boundaries within multi-tenant or enterprise environments. Since Keycloak is widely used for identity and access management in cloud-native and enterprise applications, the vulnerability could affect numerous organizations globally. The impact is particularly significant for organizations with strict access controls based on organizational membership, such as financial institutions, healthcare providers, and large enterprises. However, the vulnerability does not affect system availability and requires an attacker to have at least low-level authenticated access, limiting the scope somewhat.
Mitigation Recommendations
To mitigate CVE-2025-1391, organizations should first upgrade Keycloak to a version where this vulnerability is patched once available. Until a patch is released, administrators should review and tighten the configuration of organization mappers, avoiding reliance solely on username or email domain pattern matching for organization assignment. Implement additional authorization checks within applications that do not trust token claims blindly; for example, verify organization membership against a backend authoritative source. Employ strict monitoring and logging of authentication and authorization events to detect anomalous access patterns. Limit the exposure of Keycloak endpoints to trusted networks and enforce strong authentication policies to reduce the risk of low-privilege user exploitation. Finally, conduct thorough security assessments of identity and access management workflows to ensure no other similar logic flaws exist.
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- redhat
- Date Reserved
- 2025-02-17T08:56:42.702Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 68b36dfcad5a09ad00944d38
Added to database: 8/30/2025, 9:32:44 PM
Last enriched: 2/27/2026, 12:14:06 PM
Last updated: 3/25/2026, 10:28:19 AM
Views: 202
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.