reportValidity to steal window focus able to overlap fullscreen notification toast
A web page could steal window focus from another page by repeatedly triggering the reportValidity JavaScript method, allowing it to overlap the fullscreen notification toast on Windows 11. This could let an attacker obscure the browser's fullscreen warning.
Originally disclosed on Mozilla
- Fixed in 5 days
- Paid in 9 days
- Disclosed after 5 days
Created attachment 9445947 xtestcase.bundle.html
When user on web page A window, then other web page B trigger JS reportValidity, the web page B window able to steal focus from page A window.
After launching both site in popup window, then trigger reportValidity repeatedly, it able to steal window focus to overlap fullscreen notification toast on Windows 11.
Tested works on Firefox 134.0 (64-bit) and Firefox Nightly 135.0a1 (2025-01-06) (64-bit) on both my laptop Intel i5-1035G and desktop PC.
When running mozregression, it show it is a regression of Bug 1922956 - Further clean-up widget creation code-paths
Steps to reproduce:
- Visit attached xtestcase.bundle.html
- Click "Launch Opener Window"
- Click "Launch Fullscreen Window"
- Click anywhere inside the page
- Opener Window shown at the top of fullscreen notification toast
(If still doesn't work, I found a trick by right click before "Launch Fullscreen Window", it will works all the time; on the attached video I perform that without the right-click)
- Visit attached xtestcase.bundle.html
- Click "Launch Opener Window"
- When you see "Launch Fullscreen Window"
- Right click
- Left click "Launch Fullscreen Window"
- Left click anywhere inside the page
- Opener Window shown at the top of fullscreen notification toast
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
Root cause
Likely a regression in widget creation code-paths that allowed focus stealing via the reportValidity method.
Impact
An attacker could overlap the fullscreen notification toast, potentially hiding a security warning from the user.
What the attacker needed
Victim visits a malicious page; victim interacts with the page
How it was found
- Visit the test case page
- Click 'Launch Opener Window'
- Click 'Launch Fullscreen Window'
- Click anywhere inside the page
- Observe the opener window overlapping the fullscreen notification toast
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 shows a form validation message, it can sometimes take focus away from another window. Here, a malicious page used this to cover up a security warning that appears when a site goes fullscreen, which could trick users.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.