
Vulnerability details and exploit for CVE-2021-3754
This repository documents Vulnerability details and exploit for CVE-2021-3754 discovered and reported by myself on 21st August 2021
A flaw was found in Apache Keycloak & Redhat SSO where an attacker is able to register himself with the username same as the email ID of any existing user.
This is caused by usernames being evaluated before emails.
Keycloak allows the use of email as a username and doesn't check that an account with this email already exists.

The above behavior will cause trouble getting a password recovery email if the user forgets the password, thereby locking users out of their accounts temporarily.

The workaround is to enable the "Email as username" flag or disable "Login with email" in the login settings.
Reference

Following is a proof of concept video that I initially reported to Redhat, which demonstrates the complete vulnerability along with exploitation steps: