Hello.
I would like to ask a question about the email+password authentication flow.
Note: I am assuming that we will not be using the email-only sign-in flow in this case.
For Email+Password authentication, we first run createUserWithEmailAndPassword to create the user in firebase authentication, then sendEmailVerification(https://
firebase.google.com/docs/reference/js/auth.md?hl=en#sendemailverification) to confirm the identity of the Email.
This flow is also described in the official Firebase blog.
https://firebase.googleblog.com/2017/02/email-verification-in-firebase-auth.htmlHowever, there are several security and privacy concerns with this authentication flow.
1. if a user is created without verifying that the email is his/her own, he/she can register for the service with someone else's email address. The email address will remain in firebase authentication database unless the person tries to log in with that email address, or until they receive an email confirming their email address, without their knowledge.
Why doesn't the email+password authentication user creation process provide for prior confirmation of the email address's identity? (Even though email-only authentication involves sending the email address in advance...)
2. there is a risk of creating a mailing list of users registered for the service if the event concerned in 1. is exploited.
For example, suppose you have created a web service for wealthy people, and you create this authentication flow. A malicious user attempts to register an unspecified number of email addresses with the service.Then, some responses will return the error "A user has already been created for this email address"(reference:
https://firebase.google.com/docs/reference/js/auth.md#createuserwithemailandpassword) . In other words, the owner of the email address that returned the response is a wealthy person, and a third party is told that the owner of the email address is a wealthy person.
This is designated by OWASP as a bad authentication flow.
https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html#incorrect-and- correct-response-examples
With the above in mind, let me summarize my question.
For Email+Password authentication only, does firebase authentication provide a way to verify the identity of the email before creatEmailUserWithEmailAndPassword? (sendSignInLinkToEmail is not available. Because I assume that email-link authentication will not be used in this case.)
Also, does Firebase have official documentation that fixes the above issues I have raised as concerns?
Or is this concern of mine misplaced?
That is all. Thank you for taking the time to read this long question.
Translated with
www.DeepL.com/Translator (free version)