Skip to content
XSS Disclosed report Intermediate

[HackerOne] HTML Injection / Reflected Cross-Site Scripting with CSP on https://accounts.firefox.com/settings

The flowId parameter on the Firefox accounts settings page was reflected into the server response without HTML escaping, allowing an attacker to inject arbitrary HTML. The reporter demonstrated an open redirect and a fake download prompt, but could not achieve script execution because the site's Content-Security-Policy blocked inline and external scripts.

Frida K Follow

Originally disclosed on Mozilla

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

Link: https://hackerone.com/reports/1880896
Date: 2023-02-21 11:35:05 UTC
By: celesian
Weakness: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

Details:

Summary:

Good morning,

There is a vulnerability on accounts.firefox.com, where the flowId parameter is reflected into the server response without being escaped for HTML. This causes a Cross-Site Scripting attack, which may allow attackers to take over accounts. To do that, one would need to bypass the Content-Security-Policy on Firefox's website, which looks like this:

HTTP
Content-Security-Policy: connect-src 'self' https://api.accounts.firefox.com https://graphql.accounts.firefox.com https://oauth.accounts.firefox.com https://profile.accounts.firefox.com wss://channelserver.services.mozilla.com https://channelserver.services.mozilla.com https://*.sentry.io http://localhost:4318;default-src 'self';form-action 'self' https://accounts.google.com https://appleid.apple.com;font-src 'self' https://accounts-static.cdn.mozilla.net;frame-src 'none';img-src 'self' blob: data: https://secure.gravatar.com https://firefoxusercontent.com https://profile.accounts.firefox.com https://accounts-static.cdn.mozilla.net;media-src blob:;object-src 'none';report-uri /_/csp-violation;script-src 'self' https://accounts-static.cdn.mozilla.net;style-src 'self' https://accounts-static.cdn.mozilla.net;base-uri 'self';frame-ancestors 'self';script-src-attr 'none';upgrade-insecure-requests

Bypassing the Content-Security-Policy was not done yet, and I am not sure if its even doable. Therefore I am reporting the vulnerability as is because even without Javascript execution there are some attacks that are still possible script-less. One theoretical attack that could be possible is using the connect-src directive to make requests to the http://localhost:4318 URL and then possibly leak traces or other sensitive data from OpenTelemetry Collector (making Mozilla employees possibly a target for this attack).

PoCs

  1. Open Redirect

https://accounts.firefox.com/settings?deviceId=cc10a15a5ac94bdf8a9a0bc5b2912520&flowBeginTime=1676972087857&flowId=%22%3E%3Cmeta%20http-equiv=%22refresh%22%20content=%221;%20http://example.com%22%3E&broker=web&context=web&isSampledUser=false&service=none&uniqueUserId=dbf23f86-d3d1-4576-92bc-ebaa4fd14795

  1. UI Redressing

https://accounts.firefox.com/settings?deviceId=cc10a15a5ac94bdf8a9a0bc5b2912520&flowBeginTime=1676972087857&flowId=e587d1d6ceb%22%3E%3Ch1%3EYour+machine+needs+to+be+analyzed.+Please+download+and+run+this+file+to+continue%3a+%3Ca+href%3d%22http%3a//evil.tld/a.exe%22%3EClick%20here%20to%20Download%3C/a%3E%3C/h1%3E%3C!--&broker=web&context=web&isSampledUser=false&service=none&uniqueUserId=dbf23f86-d3d1-4576-92bc-ebaa4fd14795

Impact

An attacker can inject HTML on the page and potentially run attacks involving user interaction, with achieving arbitrary javascript code execution not being possible due to the Content Security Policy installed on the server.

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

Impact

An attacker could inject HTML to redirect users or show fake content that tricks them into actions, but arbitrary JavaScript execution was not possible because of the Content-Security-Policy.

What the attacker needed

Victim clicks a crafted link

How it was found

  1. Craft a settings URL with a flowId value containing HTML markup.
  2. Open the URL in a browser.
  3. Observe the injected markup rendered on the page, for example a meta refresh redirect or a fake download heading.

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 website puts text from the address bar straight into its page without cleaning it, an attacker can slip in their own HTML, the language web pages are built from. Here the attacker could add a fake message or a redirect to another site, but the site's security rules (a Content-Security-Policy, a list of what the browser is allowed to load) stopped them from running JavaScript, the code that would let them steal accounts.

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 Frida K

View all

1 more disclosed report, 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.