Skip to content
XSS Disclosed report Advanced CVE-2026-24868

CSP strict-dynamic bypass via shimmed Disqus embed code

Firefox's Disqus embed shim used a loose selector that matched a non-Disqus script element, so when the user allowed the blocked embed, the shim re-created and loaded that attacker-controlled script. Because the script was inserted by trusted extension code, it bypassed a page's strict-dynamic CSP and ran arbitrary JavaScript.

Masato Kinugawa Follow

Originally disclosed on Mozilla

  • Fixed in 15 days
  • Paid in 24 days
  • Disclosed after 15 days

Created attachment 9534423 fx_csp_bypass_strict-dynamic_disqus.html

Summary

This is a similar bug to Bug 1909241. When Firefox's Strict Enhanced Tracking Protection is enabled, certain tracking contents are shimmed. Disqus embed code is one of them. When Firefox detects the Disqus embed code, loading is blocked until the user explicitly allows it. This unblocking process can be abused to bypass CSP strict-dynamic. It allows an attacker to execute arbitrary JavaScript even if the page has strict CSP rules.

Steps to reproduce

  1. Open https://vulnerabledoma.in/fx_csp_bypass_strict-dynamic_disqus.html with Strict Enhanced Tracking Protection enabled. This page contains strict CSP rules:
HTML
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'nonce-random' 'strict-dynamic';  [...]">
  1. Click on the Allow on vulnerabledoma.in button.
  2. Click on the Allow Disqus toggle button. An alert dialog will pop up.

Root cause

This querySelector call incorrectly selects a non-Disqus script: https://searchfox.org/firefox-main/rev/2fd8beb47a8fd1a767e35a987dff4e0ec2536245/browser/extensions/webcompat/shims/disqus-embed.js#13-15 In the PoC case, <script src="data:,alert(document.domain)//.disqus.com/embed.js"></script> is retrieved wrongly.

After loading is allowed via the toggle button, the script is loaded via the following createElement(), bypassing strict-dynamic: https://searchfox.org/firefox-main/rev/2fd8beb47a8fd1a767e35a987dff4e0ec2536245/browser/extensions/webcompat/lib/smartblock_embeds_helper.js#52-58

The original report as published on Mozilla's Bugzilla, by Masato Kinugawa. 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 execute arbitrary JavaScript on a page with a strict strict-dynamic CSP, but only if the victim uses Firefox with Strict Enhanced Tracking Protection and manually allows the blocked embed.

What the attacker needed

Firefox with Strict Enhanced Tracking Protection; Victim allows the site; Victim allows the Disqus embed

How it was found

  1. Open the test page with Strict Enhanced Tracking Protection enabled; the page sets a strict CSP with a nonce and strict-dynamic.
  2. Click the button to allow the site.
  3. Click the toggle to allow Disqus; an alert dialog appears.

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.

A Content Security Policy (CSP) is a rule set a website sends to the browser saying which scripts may run. The strict-dynamic keyword lets a script that is already trusted load further scripts, so the browser trusts whatever those scripts insert. Here a Firefox feature that unblocks embedded Disqus comments picked the wrong script tag and loaded it as if it were trusted, letting an attacker's code run.

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 Masato Kinugawa

View all

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