Background tab datalist popup can appear in the foreground tab
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
| 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:
- Save the two files below as
tab-a.htmlandtab-b.htmlin the same directory. - Serve that directory over HTTP. For example:
python3 -m http.server 8000 - Open
http://a.localhost.ntomoya.com:8000/tab-a.htmlin tab A andhttp://b.localhost.ntomoya.com:8000/tab-b.htmlin tab B of the same Firefox window. - Switch back to tab A.
- Click the "Arm background popup" button in tab A and immediately switch to tab B before 500 ms elapse.
- 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.
| Reporter | ||
Comment 1•5 months ago
|
||
| Reporter | ||
Comment 2•5 months ago
|
||
| Reporter | ||
Comment 3•5 months ago
|
||
Updated•5 months ago
|
Updated•5 months ago
|
Comment 4•5 months ago
|
||
Hi Vincent, I think you have worked on this. Could you take a look?
| Assignee | ||
Comment 5•5 months ago
|
||
Updated•5 months ago
|
| Assignee | ||
Comment 6•5 months ago
|
||
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.
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 7•5 months ago
|
||
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.
Updated•5 months ago
|
| Assignee | ||
Comment 9•5 months ago
|
||
Issue was introduced by bug 1767228, shipped by bug 1998668 in 149. I verified the issue reproduces in release.
Comment 10•5 months ago
|
||
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Updated•26 days ago
|
Updated•24 days ago
|
Updated•24 days ago
|
Description
•