Skip to content
Account takeover Disclosed report Advanced CVE-2024-9956

A vulnerability in Firefox mobile allows attackers to trigger fido:/ links, hijacking FIDO2 accounts by tricking victims into authenticating malicious requests, bypassing 2FA, and taking over accounts.

Firefox mobile treats fido:/ URIs as deep links, so a page on any origin can trigger the passkey authentication overlay that was generated for a different relying party. An attacker who starts a WebAuthn login for the victim's account can phish the victim into approving it, letting the attacker log in as the victim or bypass 2FA.

mastersplinter Follow

Originally disclosed on Mozilla

  • Fixed in 4 months
  • Paid in 5 months
  • Disclosed after 4 months

Created attachment 9428631 firefox-passkey.zip

A vulnerability in Firefox mobile allows attackers to trigger fido:/ links, hijacking FIDO2 accounts by tricking victims into authenticating malicious requests, bypassing 2FA, and taking over accounts.

In Firefox mobile an attacker page can trigger navigation to a fido:/ link that was generated on a different origin for a webauthn authentication, this will trigger on the victim's mobile device the same passkey overlay requesting authentication as though they had scanned the QR code. This is because fido:/ URIs are treated as deep links by the base OS. This allows an adjacent network attacker to take over a victim's account (or bypass 2FA) for an RP where they have registered FIDO2 credentials on with the following steps:

  • The attacker obtains the victim's username (either via enumeration of the webauthn registration endpoint) or in any other way depending on the attack
  • The attacker automates the steps required to start a webauthn authentication on the selected RP as well as grabbing the fido:/ out of the QR code, using a headless browser
  • The attacker places himself in an adjacent network range to the victim and sends his attacker controlled page to the victim
  • Once the victim clicks on the link the automated steps defined earlier a run and the fido:/ link is triggered in the victim's browser
  • The legitimate FIDO2 request is accepted by the victim as he relies on the knowledge that his RP's account must be safe as this is a different origin
  • The victim's device completes the authentication which is however happening on the attacker's controlled device, allowing the attacker to login with the victim's credentials.

While the attack is similar to proxying a QR code directly and tricking the victim into scanning it an completing the authentication request, the attack complexity using the presented approach drops rapidly, this because it only requires the victim to be phished on only one device and breaks the security boundary of: "An RP's webauthn authentication request can only be started from approved origin".

I am not certain if this is an issue that should be addressed at a browser level or if the mobile OS should validate which applications are allowed to trigger a fido:/ deep-link. However I do not see the need from a browser perspective to be able to trigger such a deep-link from any origin as that breaches a clear security boundary. I would love to hear your thoughts about this.

Additionally chaining this with the bug previously reported about content spoofing, it is possible for an attacker to completely forge a PassKey authentication that looks legitimate. Bug is found here: https://bugzilla.mozilla.org/show_bug.cgi?id=1916379

PoC

The PoC can be simplified by simply decoding a webauthn QR code from a chromium based browser, embedding the fido:/ link in a page and then using a secondary device to visit that page and clicking on the link.

To better showcase this I have attached a zip file containing a Go program that automates the attack showcased. The program has the following dependencies:

  • Must be run on a Unix based system with BLE
  • chromium-browser or google-chrome must be installed (used for the headless browsers steps)
  • imagemagick tools (used for grabbing the QR code from the headless browser popup)

To reproduce the attack:

  • Pick a mobile device which supports passkeys
  • Head over to https://webauthn.io (used as poc) and create an account using the device as passkey
  • Run the program with go run . -email {email used for victim account}
  • Visit the malicious webserver (listening on port 8000) with the device and click on the link in the page.

In the zip file, a video demo is included as well, showcasing the victim's view on the bottom right.

Impact

An attacker within BLE range of its victim can obtain a valid FIDO2 authentication on any RP desired and use the victim's device to complete such authentication. This allows him to take over accounts directly and/or bypass 2FA protections on the RP, breaking the security boundary that explicitly states that one origin cannot trigger a webauthn auth request (or registration) for a different origin.

The original report as published on Mozilla's Bugzilla, by MasterSplinter. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the browser passes fido:/ URIs to the operating system as deep links without checking that the requesting page's origin matches the origin that generated the authentication request.

Impact

An attacker within Bluetooth range of the victim could obtain a valid FIDO2 authentication for any relying party and use the victim's device to complete it, taking over accounts or bypassing 2FA; the report notes the attack still needs the victim to approve the prompt.

What the attacker needed

Victim uses Firefox mobile with a passkey; attacker knows the victim's username; attacker within BLE range; victim clicks a link and approves prompt

The fix

The browser should not let a page on any origin trigger a fido:/ deep link, or the mobile OS should validate which applications may handle such links.

How it was found

  1. The attacker learns the victim's username, for example by enumerating the WebAuthn registration endpoint.
  2. Using a headless browser, the attacker starts a WebAuthn authentication for the target site and extracts the fido:/ link from the QR code.
  3. The attacker sends a page containing that link to the victim, who is on the same adjacent network.
  4. The victim clicks the link, which triggers the fido:/ navigation and shows the passkey overlay.
  5. The victim approves the prompt, completing authentication on the attacker's session.
  6. The attacker logs in with the victim's credentials.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Passkeys let you log in by approving a prompt on your phone instead of typing a password. Normally only the website that asked for the login can make that prompt appear. Here, any website could make the phone show the prompt for a login the attacker started, so if the victim approves it, the attacker gets logged in as them.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by mastersplinter

View all

3 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.