Closed Bug 2033234 Opened 5 months ago Closed 5 months ago

Background tab datalist popup can appear in the foreground tab

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox150 --- wontfix
firefox151 --- wontfix
firefox152 --- fixed

People

(Reporter: tomoya2517, Assigned: vhilla)

References

(Regression)

Details

(4 keywords, Whiteboard: [client-bounty-form][adv-main152+r])

Attachments

(4 files)

Platform: Desktop
Version: Nightly 151.0a1 (2026-04-17)

Calling showPicker() on an <input> associated with a <datalist> can open Firefox's own autocomplete-style popup even after the originating tab has moved to the background. A page in tab A can receive a normal user gesture, schedule input.showPicker() with a short delay, and let the user switch to tab B before the delay expires. When the delayed call runs, Firefox shows the popup on top of the selected foreground tab, even though tab B did not request the popup.

Steps to Reproduce:

  1. Save the two files below as tab-a.html and tab-b.html in the same directory.
  2. Serve that directory over HTTP. For example:
    python3 -m http.server 8000
  3. Open http://a.localhost.ntomoya.com:8000/tab-a.html in tab A and http://b.localhost.ntomoya.com:8000/tab-b.html in tab B of the same Firefox window.
  4. Switch back to tab A.
  5. Click the "Arm background popup" button in tab A and immediately switch to tab B before 500 ms elapse.
  6. Observe that after roughly 500 ms, Firefox displays a normal autocomplete/datalist popup containing attacker-controlled strings on top of tab B, even though tab B did not request the popup and is cross-origin to tab A.

Security Impact:
A background tab can cause Firefox to display a trusted browser-owned popup over an unrelated foreground tab. The popup contents are attacker-controlled datalist strings, so a malicious site can inject misleading UI that looks like Firefox-provided autocomplete suggestions in the wrong tab context.

Flags: sec-bounty?
Attached video demo.mp4 —
Attached file tab-a.html —
Attached file tab-b.html —
Group: firefox-core-security → dom-core-security
Component: Security → DOM: Core & HTML
Product: Firefox → Core

Hi Vincent, I think you have worked on this. Could you take a look?

Flags: needinfo?(vhilla)
See Also: → 2033509
Attached file (secure) —
Assignee: nobody → vhilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

This was implemented in bug 1767228, I think we can use BC::CanOpenModalPicker that was introduced in bug 1837963 and would make the code more consistent.

Flags: needinfo?(vhilla)
Keywords: sec-low

SelectParent.sys.mjs has an open method that checks

      if (tabbrowser && tabbrowser.selectedBrowser != browser) {
         // AsyncTabSwitcher might delay activating our browser, check
         // explicitly for tabbrowser.
         return false;
       }

This comes from bug 1909535 and I wonder whether AutoCompleteParent should have that check too in addition to BC::CanOpenModalPicker.

I couldn't get bug 1909535 to reproduce with a datalist picker though. Opening a new window causes a blur event that causes nsFormFillController to StopControllingInput. To get the picker to open and remain open on another page, one has to call showPicker after blur has fired, meaning CanOpenModalPicker would be false due to a lack of focus.

But this does seem a bit fragile, adding the check is harmless, and having the check in both places is more consistent.

See Also: → 2035124
Severity: -- → S3
Pushed by vhilla@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a91851cbc2da https://hg.mozilla.org/integration/autoland/rev/e76f2fc3d9fe Use BC::CanOpenModalPicker for all picker. r=edgar,firefox-desktop-core-reviewers ,Gijs,extension-reviewers,robwu,devtools-reviewers,nchevobbe

Issue was introduced by bug 1767228, shipped by bug 1998668 in 149. I verified the issue reproduces in release.

Group: dom-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Keywords: regression
Regressed by: 1767228, 1998668
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
See Also: → 2038975
QA Whiteboard: [sec] [qa-triage-done-c153/b152]
Flags: sec-bounty? → sec-bounty-
Whiteboard: [client-bounty-form] → [client-bounty-form][adv-main152+r]
Whiteboard: [client-bounty-form][adv-main152+r] → [client-bounty-form][adv-main152+r][adv-main152+]
Group: core-security-release
Alias: CVE-2026-12326
Alias: CVE-2026-12326
Whiteboard: [client-bounty-form][adv-main152+r][adv-main152+] → [client-bounty-form][adv-main152+r]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: