The vulnerability is a policy bypass in Keycloak's WebAuthn registration process. The root cause is insufficient server-side validation within the org.keycloak.authentication.requiredactions.WebAuthnRegister.processAction method. An authenticated user could manipulate client-side JavaScript to send registration parameters that do not align with the realm's configured WebAuthn policies, and the server would incorrectly accept them.
The analysis of the patch commits reveals the exact location of the vulnerability. The primary fix is in the WebAuthnRegister.java file. The processAction method was modified to enforce the configured policies. Before the patch, the validation was incomplete. The patch introduces two main changes:
-
The RegistrationParameters passed to the underlying webauthn4j library now include the expected signature algorithms derived from the realm's policy. This is handled by the new buildExpectedCredentialParameters method. This ensures the library validates the algorithm used.
-
A new inner class, PolicyVerifier, was added to perform additional server-side checks that are not covered by the webauthn4j library's validation. This includes verifying the authenticatorAttachment and acceptableAaguids. The processAction method is updated to call PolicyVerifier.verifyCompliance.
By observing the code that was added to fix the vulnerability, we can identify that the processAction method was the point where the flawed logic existed. During exploitation, this function would be in the stack trace as it processes the malicious registration request.