Skip to content
OAuth / SSO Disclosed report Advanced CVE-2025-14331

Logic error in OAuth redirect validation allows cross-window interception with launchWebAuthFlow

A logic error in Firefox's OAuth redirect validation allowed an attacker-controlled tab to prematurely resolve an extension's OAuth flow by fetching the extension's predictable redirect URL. This could let the attacker supply a malicious OAuth code, binding the user's session to the attacker's account.

disclosure Follow

Originally disclosed on Mozilla

  • Fixed in 10 days
  • Paid in 12 days
  • Disclosed after 10 days

Vulnerability Details
A logic error in the redirect validation guard allows an attacker-controlled tab to prematurely resolve OAuth flows by issuing a fetch() request to the extension's predictable redirect URL. The incorrect AND condition treats channels from any tab as valid if they have a browserElement, allowing cross-window interception.
Impacted code:

JavaScript
// toolkit/components/extensions/parent/ext-identity.js:79-84
if (
  !wrapper.browserElement &&  // Logic error: should be OR, not AND
  wrapper.browserElement !== window.gBrowser.selectedBrowser
) {
  return;
}

Reproduction Steps

  1. Install a WebExtension that uses browser.identity.launchWebAuthFlow and initiate OAuth sign-in to open the popup.
  2. In an attacker-controlled tab, execute fetch("https://<extension-hash>.extensions.allizom.org/?code=malicious") using the extension's predictable redirect domain.
  3. The OAuth popup closes immediately and launchWebAuthFlow resolves with the attacker's URL.

Impact

  • Account binding: Extension receives attacker-controlled OAuth code/tokens, binding user session to attacker's account
  • Data exfiltration: User data synced after "sign-in" goes to attacker's remote account
  • Session fixation: User operates under attacker's account context within the extension

Tested on:

  • Mozilla Firefox 144.0.2 (aarch64)
  • Mozilla Firefox 146.0a1

Best regards, Igor Morgenstern Aisle Research

The original report as published on Mozilla's Bugzilla, by disclosure. 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 redirect validation used a logical AND instead of OR, so a request from any tab with a browserElement was accepted rather than only the selected browser.

Impact

The extension could receive an attacker-controlled OAuth code or tokens, binding the user's session to the attacker's account, exfiltrating synced data, or fixing the session under the attacker's context.

What the attacker needed

A WebExtension using launchWebAuthFlow; Attacker can run script in a tab; Predictable extension redirect domain

How it was found

  1. Install a WebExtension that uses browser.identity.launchWebAuthFlow and start OAuth sign-in to open the popup.
  2. In an attacker-controlled tab, send a fetch request to the extension's predictable redirect URL with a malicious code.
  3. The OAuth popup closes and launchWebAuthFlow resolves with the attacker's URL.

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.

When a browser extension signs you in to a service, it waits for the service to send back a special code to a known address. This report found that a malicious website could send a fake code to that address first, so the extension would accept the attacker's sign-in instead of yours. That could make the extension think you are logged in as the attacker.

What is OAuth / SSO?

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.

More by disclosure

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.

OAuth and single sign-on flaws

The lesson behind this report.

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.