firebasefirebase-authenticationfirebase-app-check

Firebase AppCheck for Firebase Auth


Firebase Auth provides a REST API to create/delete/edit auth users. As API Keys are not private, anybody can use the API.

The endpoint e.g. to create new users is publicly available and can't AFAIK not be disabled.

This is in my opinion a bad situation as e.g. an attacker could create via this endpoint lots of users which are no valid users for our system. An attacker could block valid email addresses of customers which are then not able to create their valid accounts.

If an attacker knows a userID he could even delete auth users.

We added user claims (which can only be set via the Admin API and not via the public API) to ensure only users created by us are allowed to access our systems but it would mean a lot of effort on our side to regularily delete users not created via our system.

Is it planned to protect FirebaseAuth also via AppCheck to allow only verified apps to access the auth api?


Solution

  • At this point, I would say it's unlikely as this type of abuse is considered a low risk in comparison to the APIs that app check is protecting.

    The public-facing Firebase Auth APIs are rate-limited and the web APIs in particular must come from your permitted auth domains. However, one of the platform's key selling points is the ability to handle many concurrent users.

    • 100 accounts/IP address/hour can be created
    • 10 accounts/second can be deleted
    • Can handle 1000 requests/second, 10 million requests/day for public APIs across a project

    The per-IP address limits are bypassed by using the Admin SDKs (subject to a 500 requests/second limit). You can also boost these limits temporarily from the Firebase Console if you are expecting a spike in demand (e.g. you offer a Black Friday sale).

    Only the Firebase Auth API for creating users is "exposed", but limited as detailed above.

    Editing, deleting, updating a user's details both metadata and the account itself are privileged actions - you must be appropriately authenticated to make changes. In the case of a user account connecting from a client device, you must have signed in within about 5 minutes to be able update/delete your own account. When using an Admin SDK, the requests are authenticated with a service account's credentials which authorizes it to make changes on behalf of users or the system.

    If your system were to abused in such a fashion, reaching out to Firebase Support would be your point of call.