AmericaSCORESBayArea / AmericaScores-CoachApp

React native based mobile app for Americas scores attendance management
5 stars 2 forks source link

Firebase fetchSignInMethodsForEmail is soon unsupported. Do we need it? #448

Open CritiqalPete opened 10 months ago

CritiqalPete commented 10 months ago

Google Firebase support calls out this method as vulnerable to an email "enumeration attack"

Is this being used for the Authenticate by Apple or Google feature? If so, we need to replace/update.

A search shows this method in two pods: RNFBAuthModule FirAuth

and two node modules: auth-public auth-credential

if it is unused, we can ignore.


We highly recommend enabling email enumeration protection on all your projects after testing with your app.

If you currently utilize fetchSignInMethodsForEmail (doc examples: Java, JS, Swift), your projects will be affected. When email enumeration is enabled, the fetchSignInForEmail API will fail. Linking anonymous authenticated users with an email address will also not work prior to SDK version 22.3.0 for Android, 10.18.0 for iOS, and 10.6.0 for Web.

A full list of affected flows is also available for review.

Additionally, FirebaseUI libraries first run fetchSignInMethodsForEmail before allowing a user to sign in with their preferred method. If you have a dependency on the library, you should evaluate impact before enabling email enumeration detection. Once FirebaseUI libraries are updated (issue 1, issue 2, issue 3, issue 4), you should enable email enumeration protection.

One or more of your projects have Firebase Auth or Google Cloud Identity Platform enabled.

We’re here to help If you have any additional questions, please look through our documentation center.

CritiqalPete commented 10 months ago

note that we have a dependent task to enable enumeration protection once this has been addressed.

CritiqalPete commented 8 months ago

need to determine the actual risk level as well as the effort to update our methods.

nglover53 commented 7 months ago

Some resources on Firebase enumeration attacks:

StackOverflow: Shows a recent (~3 month) post from user inquiring about deprecated Firebase fetchSignInMethodsForEmail. The following essentially describes:

  1. The nature of the attack: Which is a brute force method of hacking user accounts by continuously passing an email to the API and verifying correctness by checking the API response.
  2. A trivial way of addressing the vulnerability: "For now, you can disable Firebase's email enumeration protection to ensure the fetchSignInMethodsForEmail method works. If that method disappears in the future though, there is no alternative API" (see source below)
  3. A non-trivial solution which is also susceptible to enumeration attacks: Could store the same information in a database and and create a new API.

enable/disable the protection against email enumeration attacks

Analysis: I am unsure of how practical the non-trivial solution is for a user base as large as SCORES.

Google Cloud Services, Enable or disable email enumeration protection:

Additional information of note:

  1. Projects created before September 23rd 2023 do not automatically have email enumeration protection enables
  2. When email enumeration protection is enabled, your project has the following behavior:
  1. Users cannot change their email address without first verifying the new address. For example, you can no longer change a user's email address with the update REST API, the setAccountInfo REST API, or the [updateEmail]
  2. It is possible to disable EEP if certain failsafes exist, although this is not recommended:

Conclusive Recommendations from Google Cloud:

  1. If your apps don't rely on any of the behaviors described earlier in this guide, we recommend that you enable email enumeration protection immediately.

If your apps rely on any of the behaviors described earlier, we recommend that you begin migrating away from doing so, and enable email enumeration protection as soon as you can.

https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection

nglover53 commented 7 months ago

Notes from Triage (4/5)

@CritiqalPete

za-zohaib commented 6 months ago

@CritiqalPete tried to find "fetchSignInMethodsForEmail" but it seems like recent updates have fixed this so its not looking as an issue for us. Thanks