MEDIUM 4.8

CVE-2026-14781: Keycloak OIDC Email Verification Bypass & Account Takeover Risk

Keycloak's OIDC identity provider feature contains a flaw in how it validates email addresses when integrating with external authentication systems. When configured to trust email claims from an upstream OIDC provider, Keycloak retrieves the actual email address from one source (userinfo endpoint) but checks whether that email is verified using a claim from a different source (the id_token). If an attacker controls the upstream OIDC provider and makes these two sources return different email addresses, Keycloak will incorrectly mark the userinfo email as verified based on the id_token claim, even though that claim refers to a completely different email address. This allows an attacker to bypass email verification controls and potentially take over accounts in applications that rely on the email_verified flag for account linking.

Source data · NVD / CISA · public domain

CVSS
3.1 · 4.8 MEDIUM · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
Weaknesses (CWE)
CWE-1288
Affected products
1 configuration(s)
Published / Modified
2026-07-05 / 2026-08-11

NVD description (verbatim)

A flaw exists in the org.keycloak.broker.oidc package where the OIDC broker incorrectly synchronizes the email_verified claim. When an OIDC identity provider is configured with trustEmail=true and the userinfo endpoint is enabled, Keycloak retrieves the email address from the userinfo response but retrieves the email_verified status exclusively from the id_token. The root cause is a lack of validation ensuring that the email_verified claim in the id_token actually refers to the email address returned by the userinfo endpoint. If these two sources return different email addresses, the id_token's email_verified=true claim is blindly applied to the userinfo email. Exploitation Conditions: The OIDC identity provider must have trustEmail set to true (non-default). The userinfo endpoint must be enabled (default). The attacker must control or have compromised the upstream OIDC provider. Concrete Impact: Mark arbitrary email addresses as verified in the Keycloak database. Bypass email-based security controls or verification workflows. Potential account takeover if the application relies solely on the email_verified flag from the IdP to link accounts.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in org.keycloak.broker.oidc where email claim synchronization lacks proper validation. Specifically, when trustEmail=true and userinfo is enabled, the code retrieves the email address from the userinfo endpoint response but obtains the email_verified status exclusively from the id_token without cross-referencing whether the verified claim actually applies to the userinfo email. The flaw is the absence of a check confirming that the email address in the id_token's email_verified claim matches the email address returned by userinfo. An attacker controlling the upstream OIDC provider can craft a response where userinfo contains email A (marked unverified in id_token) while id_token contains email B (marked as email_verified=true), causing Keycloak to apply the verified status to email A in its database. CWE-1288 (Improper Validation of Consistency within Related Data) describes this root cause.

Business impact

Organizations using Keycloak with federated identity providers may find email-based security controls circumvented. If an application relies on the email_verified flag from an OIDC IdP to automatically link accounts or grant access, an attacker exploiting this flaw can establish or take over accounts using arbitrary email addresses marked as verified. The impact is most severe in environments where email domain belongs to the organization (company.com) or where email is the primary account identifier. Organizations using Keycloak for employee or customer identity federation should assess their email verification workflows.

Affected systems

Red Hat build of Keycloak is affected. The flaw requires non-default configuration (trustEmail=true on the OIDC identity provider) combined with a standard feature (userinfo endpoint enabled by default). Installations where trustEmail is not explicitly set to true are not vulnerable. Organizations should audit their OIDC broker configurations to identify which providers have trustEmail=true enabled.

Exploitability

Exploitation requires an attacker to control or compromise the upstream OIDC identity provider. An attacker cannot trigger this flaw from a downstream application; they must have the ability to craft the userinfo response and id_token from the IdP itself. This significantly constrains exploitability in scenarios where the IdP is a trusted third-party service (like an enterprise SSO system or major cloud provider). However, in federated multi-tenant or partner scenarios where organizations configure custom or partner-operated OIDC providers, the risk increases. The CVSS score of 4.8 (MEDIUM) reflects these limited but realistic attack conditions.

Remediation

Remediation involves validating that the email address in the id_token's email_verified claim matches the email address returned by the userinfo endpoint before applying the verified status. Until a patch is available, organizations should disable trustEmail on OIDC identity providers where the upstream provider is not fully under their control, or disable the userinfo endpoint if it is not required. For critical deployments, consider implementing additional email verification logic at the application level rather than relying solely on the IdP claim.

Patch guidance

Monitor Red Hat security advisories for a Keycloak patch addressing this vulnerability. When available, apply the patch to affected Keycloak instances. Test in a non-production environment first, particularly if custom OIDC providers or broker configurations are in use. Organizations should verify against the official Red Hat Keycloak security advisory for exact patched versions and migration steps.

Detection guidance

Review Keycloak OIDC identity provider configurations to identify any with trustEmail=true. Examine audit logs for suspicious account creation or linking events, particularly those involving email addresses from external domains or unexpected account takeover attempts. Monitor for cases where an account is created with an email address marked as verified immediately upon login, especially if that email differs from the authenticated user's expected address. Cross-reference Keycloak user accounts with upstream OIDC provider logs to identify discrepancies in email claims.

Why prioritize this

This vulnerability should be prioritized for organizations running Keycloak with federated OIDC providers, particularly those with trustEmail=true and relying on email verification for account linking or access control. While the CVSS score is MEDIUM and exploitability is constrained to compromised IdPs, the business impact of email verification bypass and account takeover is significant. Priority should be highest for multi-tenant or partner federation scenarios. Organizations using only trusted, controlled OIDC providers (internal SSO systems) may deprioritize slightly, but should still remediate.

Risk score, explained

CVSS 4.8 (MEDIUM) reflects a low attack vector (network-accessible but IdP compromise required), high attack complexity (attacker must control upstream provider), no privileges or user interaction needed, and limited impact scope. The integrity impact (ability to modify email_verified status) and confidentiality impact (potential to access accounts) justify the MEDIUM rating rather than LOW. The score would be higher if exploitation required only downstream application control, but the requirement to compromise the IdP constrains it.

Frequently asked questions

Does this affect Keycloak instances that do not use OIDC federation?

No. This vulnerability is specific to Keycloak's OIDC identity broker feature. Standalone Keycloak deployments or those using only SAML, LDAP, or other authentication methods are not affected.

If we use a trustworthy third-party OIDC provider like Google or Okta, are we at risk?

The attack requires compromising or controlling the upstream OIDC provider itself. If you trust your OIDC provider and it is secure, the practical risk is low. However, if you use custom-developed, partner-operated, or less-established OIDC providers, the risk increases. Review your provider security posture and consider whether trustEmail=true is necessary for your use case.

Can we mitigate this without waiting for a patch?

Yes. Disable trustEmail on OIDC brokers where the provider is not fully under your control, or disable the userinfo endpoint if it is not required. Alternatively, implement email verification logic in your application rather than relying on the IdP claim. However, these are temporary mitigations; a patch should be applied when available.

What should we look for in Keycloak audit logs?

Look for user accounts created or linked with email addresses marked as verified on first login, especially if those email addresses differ from the user's expected domain or prior account history. Unexpected email domain changes during account linking events may indicate exploitation.

This analysis is based on published vulnerability data as of the document date. No exploit code or weaponized proof-of-concept is provided. Organizations should verify all technical details, affected versions, and patch availability against official Red Hat Keycloak security advisories before taking action. CVSS scores and severity ratings are provided as context and should not be the sole basis for remediation prioritization. Testing patches in non-production environments is mandatory. This explainer does not constitute legal, compliance, or business advice. Source: NVD (public-domain), retrieved 2026-08-13. Analysis generated by SEC.co (claude-haiku-4-5).