firebase / firebase/firebase-js-sdk

Firebase Auth signs out user when receives error 429 - too many requests

Open
#9,259 1 comment 0 reactions 0 assignees View on GitHub
api: auth needs-attention question Repro Needed
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Operating System

Mac Sequoia 15.6.1

### Environment (if applicable)

Latest Chrome

### Firebase SDK Version

12.2.1

### Firebase SDK Product(s)

Auth

### Project Tooling

Webpack

### Detailed Problem Description

### Issue
When Firebase Auth refreshes the user token via
`https://identitytoolkit.googleapis.com/v1/accounts:lookup`,
if the server responds with status **429 (Too Many Requests)**, Firebase JS SDK automatically deletes the local cached token and signs out the current user. This does not happen for Firebase iOS and Android SDK.

### Impact
This behavior can be exploited by an attacker: by spamming authentication services (e.g., sign-up or password reset), they can trigger 429 responses and force sign-outs for all valid users of the project.

### Steps and code to reproduce issue

Please mock the 429 (too many requests) response from Firebase endpoint `https://identitytoolkit.googleapis.com/v1/accounts:lookup`. After receiving 429 response error, the token is removed from IndexedDB and localStorage and the current user is signed out.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the mocked 429 response from the Firebase Auth accounts:lookup endpoint in the TypeScript SDK and inspect how the error affects IndexedDB, localStorage, and the current user. Done means a 429 no longer removes the cached token or signs out a valid user, with behavior verified against the reported reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
authentication, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.