CVE-2025-3910: Keycloak vulnerable to two factor authentication bypass
5.4
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.0438%
CWE
Published
4/30/2025
Updated
4/30/2025
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
org.keycloak:keycloak-services | maven | < 26.2.2 | 26.2.2 |
Vulnerability Intelligence
Miggo AI
Root 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 thekcActionStatus
toERROR
instead ofSUCCESS
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 thekc_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 booleankcActionExecution
toexecuteAction
. InLoginActionsService.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 acancelled
flag and triggers the appropriate error events and subsequent authentication flow viaAuthenticationManager.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.