Repository navigation
Feature #43649: Add Phone OTP Authenticator - #49606
joaoccarvalhoo wants to merge 1 commit into
Conversation
Implement Phone OTP browser authenticator with code generation, hashing, TTL, max attempts, and resend cooldown. Add PhoneOtpAuthenticatorFactory and PhoneOtpUtils for shared OTP utilities. Implement VerifyPhoneNumber required action to collect and verify user phone numbers. Add integration tests and page objects (PhoneOtpFlowTest, PhoneOtpLoginPage, PhoneOtpCodePage, VerifyPhoneNumberPage, VerifyPhoneNumberCodePage) covering login, invalid codes, resend cooldown, and required-action flow. Closes keycloak#43649 Signed-off-by: Joao Carvalho <joao.cipriano.carvalho@tecnico.ulisboa.pt> Co-authored-by: Chloe Romão <chloe.romao@tecnico.ulisboa.pt>
|
Hi @joaoccarvalhoo, I'm sharing this from Niro, a PR pentesting tool we're building to help OSS maintainers catch security regressions before merge. I ran it against this PR and it found the following issue. Any unauthenticated caller can test phone numbers against the niro realm and learn which numbers are registered users, giving them a reusable account-enumeration oracle for targeted attacks. Reproduction StepsPrecondition: none; no credentials are required.
Remediation GuidanceIn services/src/main/java/org/keycloak/authentication/authenticators/browser/PhoneOtpAuthenticator.java, remove the distinct invalid-phone response from the phone lookup path. |
Implement Phone OTP browser authenticator with code generation, hashing, TTL, max attempts, and resend cooldown.
Add PhoneOtpAuthenticatorFactory and PhoneOtpUtils for shared OTP utilities.
Implement VerifyPhoneNumber required action to collect and verify user phone numbers.
Add integration tests and page objects (PhoneOtpFlowTest, PhoneOtpLoginPage, PhoneOtpCodePage, VerifyPhoneNumberPage, VerifyPhoneNumberCodePage) covering login, invalid codes, resend cooldown, and required-action flow.
Closes #43649