Miggo Logo

CVE-2025-3910: Keycloak vulnerable to two factor authentication bypass

5.4

CVSS Score
3.1

Basic Information

EPSS Score
0.0438%
Published
4/30/2025
Updated
4/30/2025
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.keycloak:keycloak-servicesmaven< 26.2.226.2.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability allows bypassing required actions, like 2FA, by leveraging Application-Initiated Actions (AIA). The core issue lies in how the system handled the cancellation or ignoring of these AIAs. The commit a78c951a5aeb820d01d2987397e24b3362c455f0 addresses this by modifying key methods in AuthenticationManager.java and LoginActionsService.java. In AuthenticationManager.java:

  • executeAction was changed to set the kcActionStatus to ERROR instead of SUCCESS when an action is ignored. This prevents the system from incorrectly believing a required action was completed when it was actually bypassed due to an AIA cancellation.
  • getApplicableRequiredActionsSorted was updated to correctly order and include the kc_action (AIA) in the list of actions, ensuring it doesn't improperly supersede or cause the skipping of other genuine required actions.
  • executionActions was updated to pass a more precise boolean kcActionExecution to executeAction. In LoginActionsService.java:
  • The ignore method was updated to explicitly handle the cancellation of an AIA. Instead of potentially marking the context as successful, it now sets a cancelled flag and triggers the appropriate error events and subsequent authentication flow via AuthenticationManager.nextActionAfterAuthentication. These changes collectively ensure that cancelling an AIA does not lead to the inadvertent removal or bypass of other legitimate required actions, thus fixing the 2FA bypass vulnerability. The identified functions are central to processing authentication flows, required actions, and application-initiated actions.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

# **s*ription * *l*w w*s *oun* in K*y*lo*k. T** or*.k*y*lo*k.*ut*oriz*tion p**k*** m*y ** vuln*r**l* to *ir*umv*ntin* r*quir** **tions, *llowin* us*rs to *ir*umv*nt r*quir*m*nts su** *s s*ttin* up two-***tor *ut**nti**tion.

Reasoning

T** vuln*r**ility *llows *yp*ssin* r*quir** **tions, lik* ***, *y l*v*r**in* *ppli**tion-Initi*t** **tions (*I*). T** *or* issu* li*s in *ow t** syst*m **n*l** t** **n**ll*tion or i*norin* o* t**s* *I*s. T** *ommit `*********************************