Skip to content

docs(auth): clarify fetchSignInMethodsForEmail behavior with email enumeration protection #8518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025

Conversation

No898
Copy link
Contributor

@No898 No898 commented May 7, 2025

docs(auth): clarify fetchSignInMethodsForEmail behavior with email enumeration protection

Description

This pull request clarifies the behavior of fetchSignInMethodsForEmail in the context of Firebase Authentication when Email Enumeration Protection is enabled (which is the default setting in Firebase).

The updated JSDoc comment explains that:

  • The method may return an empty array even for existing users,
  • Especially when called from an unauthenticated context,
  • This behavior is by design to prevent email enumeration attacks.

The goal is to help developers understand the limitations of this method and avoid using its result for direct user feedback about account existence, which could lead to security vulnerabilities.

Related issues

None reported, but this clarification aligns with security considerations discussed in firebase/firebase-js-sdk#4514.

Release Summary

Clarified the JSDoc for fetchSignInMethodsForEmail in the Auth module to include a note about email enumeration protection and its effects.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My change supports the following platforms:
    • Android
    • iOS
  • My change includes tests:
    • e2e tests added or updated in packages/**/e2e
    • jest tests added or updated in packages/**/__tests__
    • Not applicable (documentation only)
  • I have updated TypeScript types that are affected by my change (only JSDoc comment change).
  • This is not a breaking change.

Test Plan

No code changes — documentation only.


Think react-native-firebase is great? Please consider supporting the project:

…umeration protection

This update enhances the JSDoc comment for fetchSignInMethodsForEmail by explaining its behavior when "Email Enumeration Protection" is enabled in Firebase Authentication settings (which is the default). It notes that the method may return an empty array even for existing accounts when called from an unauthenticated context. This clarification aims to prevent confusion and potential misuse that could lead to security vulnerabilities.
@CLAassistant
Copy link

CLAassistant commented May 7, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

vercel bot commented May 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-firebase ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 7:49pm

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @No898 👋 - you are exactly right and this document has become a little stale as it was written prior to the email enumeration protection feature and has not been updated since. This is a good change.

@mikehardy mikehardy added Workflow: Pending Merge Waiting on CI or similar plugin: authentication Firebase Authentication labels May 12, 2025
@mikehardy
Copy link
Collaborator

Passed lint now - no way a jsdoc can fail native code stuff, merging 🚂

@mikehardy mikehardy merged commit 0729030 into invertase:main May 12, 2025
15 of 16 checks passed
@mikehardy mikehardy removed the Workflow: Pending Merge Waiting on CI or similar label May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: authentication Firebase Authentication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants