Repository navigation
Description
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 fromgetRequestHeaders()without callingcontext.getHttpRequest().isProxyTrusted(). TheisProxyTrusted()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 conservativeFORCEbehavior.
This issue was originally tracked in the private repository. Migrated by @abstractj.
Metadata
Metadata
Assignees
Labels
Type
Fields
Projects
- StatusShow more project fieldsDone
Activity
mabartos commentedon Oct 7, 2026
@msdaly200 Could you please prepare backports? Thanks!