Skip to content

Security issue with email link authentication: Should not pass the user’s email in the redirect URL parameters #74

Description

@martinblostein

From here:
https://firebase.google.com/docs/auth/web/email-link-auth#security_concerns

To prevent a sign-in link from being used to sign in as an unintended user or on an unintended device, Firebase Auth requires the user's email address to be provided when completing the sign-in flow. For sign-in to succeed, this email address must match the address to which the sign-in link was originally sent.

You can streamline this flow for users who open the sign-in link on the same device they request the link, by storing their email address locally - for instance using localStorage or cookies - when you send the sign-in email. Then, use this address to complete the flow. Do not pass the user’s email in the redirect URL parameters and re-use it as this may enable session injections.

This library does exactly this in the sendOobCode method. You can verify the issue by initiating sign in on one device and then completing it on another. This should not work--the user should be required to re-enter their email address in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions