Skip to content

[CVE-2026-96445] Conditional OTP trusts skip headers on untrusted proxy paths #53112

Closed

Description

@abstractj

Describe the bug

A flaw was found in Keycloak's Conditional OTP authenticator. The skip-header policy in ConditionalOtpFormAuthenticator evaluates configured header patterns against raw request headers without verifying whether the request originates from a trusted proxy (isProxyTrusted()). An attacker who knows a victim's password can inject the header that matches the realm's configured OTP skip rule directly in their login request. Keycloak evaluates the injected header as if it were a trusted proxy-supplied value, skips the second factor, and issues an authenticated session — bypassing the realm's OTP requirement entirely.

This is tracked as CVE-2026-96445.

Version

Observed at commit c6e9851ea1ea821055f5dd11ace033aa9ebf5e15. Confirmed against Keycloak latest image.

Expected behavior

Headers must not select the SKIP OTP outcome when the request does not originate from a trusted proxy. ConditionalOtpFormAuthenticator must call context.getHttpRequest().isProxyTrusted() before evaluating skip-header rules, and must ignore matching headers when the proxy is untrusted.

Actual behavior

voteForHttpHeaderMatchesPattern() reads getRequestHeaders() and evaluates the SKIP pattern directly without checking isProxyTrusted(). A client can supply the skip-rule header in a direct login request, causing Keycloak to bypass OTP and issue an authenticated session after the first factor alone.

Anything else?

  • Root cause: ConditionalOtpFormAuthenticator.voteForHttpHeaderMatchesPattern() reads raw request headers from getRequestHeaders() without calling context.getHttpRequest().isProxyTrusted(). The isProxyTrusted() check is used elsewhere in the codebase for proxy-sourced headers but is absent from this security decision.
  • Fix direction: call isProxyTrusted() before evaluating skip-header rules and ignore matching headers when the proxy is untrusted, while retaining trusted-proxy behavior and conservative FORCE behavior.

This issue was originally tracked in the private repository. Migrated by @abstractj.

Activity

  1. added
    area/authentication
    priority/important
    kind/cve
    on Sep 23, 2026
  2. added theissue type on Sep 23, 2026
  3. self-assigned this
    on Sep 23, 2026
  4. added
    severity/medium
    on Sep 30, 2026
  5. mabartos commented on Oct 7, 2026

    @mabartos
    Member

    @msdaly200 Could you please prepare backports? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/authenticationkind/cvepriority/importantrelease/26.6.8release/26.8.1release/27.0.0severity/mediumteam/core-authn

Type

Fields

No fields configured for cve.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions