Skip to content
XSS Disclosed report Intermediate

Reflected DOM-based XSS without CSP bypass in FxA Content Server via handleOauthResponse method in ThirdPartyAuthMixin

Viridian Follow

Originally disclosed on Mozilla

  • Fixed in 22 days
  • Paid in 29 days
  • Disclosed after 22 days

Summary

The Firefox Accounts Content Server is susceptible to reflected DOM-based XSS attacks by way of the ThirdPartyAuthMixin wherein the state parameter can be used to load arbitrary JavaScript URLs.

When invoked as a GET with state and provider parameters, the /post_verify/third_party_auth/callback route hits the ThirdPartyAuthCallback class which calls handleOauthResponse() in ThirdPartyAuthMixin.

handleOauthResponse() sets window.location.href to the value of state using the navigateAway() method.

The FxA middleware enforces a strong CSP making JavaScript execution on https://accounts.firefox.com or https://accounts.stage.mozaws.net generally infeasible, however I wanted to bring this to the team's attention as FxA is considered critical in the Web Bug Bounty Program.

### Environment

  • Firefox 105.0.1 (64-bit), Firefox Developer Edition 106.0b6 (64-bit) with CSP disabled

### Steps to Reproduce

  1. Browse to https://accounts.firefox.com/post_verify/third_party_auth/callback?provider=google&state=javascript:alert(document.domain)

  2. Open DevTools and observe the CSP error (unless you disabled CSP using a WebExtension or intercept proxy, in which case you will observe an alert dialog with the value of document.domain):

    Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' https://accounts-static.cdn.mozilla.net". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.
    

Impact

An attacker can execute arbitrary JavaScript in the context of another user on https://accounts.firefox.com to exfiltrate PII and perform actions as that user provided that CSP is unsupported or disabled in the user's browser.

The original report as published on Mozilla's Bugzilla, by Viridian. 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.

What is known

A low-severity XSS bug in Server: Firefox Accounts. Mozilla made it public on 24 October 2022.

About XSS

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

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

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Viridian

View all

4 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.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.