requestPointerLock not called from short running user-generated event handler leads to Across Tab Website Clickjacking
Firefox allowed a page to request pointer lock outside a short user-generated event handler, after which mouse events were passed to that tab even when another site was loaded in it. An attacker could use this to clickjack a target website, such as starring a repository on GitHub, by luring the victim through a crafted page.
Originally disclosed on Mozilla
- Fixed in 8 days
- Paid in 8 days
- Disclosed after 8 days
Created attachment 9195173 clickjack-github.html
When page request for pointer lock that not called inside short running user-generated event handler, Firefox on Desktop unintentionally pass every mouse event into that page (even on another tab). Surprisingly I notice it affect entire tab session, so after opening the page (that requestpointerlock), then open another website on the same tab, it still pass every mouse event into that tab (even on another tab).
As a result, it is possible to clickjack the target website by opening target website into that tab. I've crafted the payload to demonstrate clickjacking on Github website.
It is nearly universal clickjacking, because when testing it able to clickjack on following popular website:
- https://www.google.com
- https://www.amazon.com
- https://bugzilla.mozilla.org
- https://www.facebook.com
- https://www.youtube.com
It's strange on some website (e.g. https://twitter.com) the mouse event no longer passed to that tab.
Version affected:
- Firefox 84.0.1 (64-bit)
- Firefox Nightly 86.0a1 (2021-01-03) (64-bit)
Version unaffected:
- Firefox 78.6.0esr (64-bit)
Steps to reproduce:
- Visit attached clickjack-github.html
- Click "Start Clickjacking on Github"
- Wait until Github fully loaded
- Click "Let's start!"
- Mouse click is pass to Github star button (If you're logged in, you've star or unstar the microsoft/vscode repositories, otherwise you'll redirected to Github login page)
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 the pointer lock request was accepted without being tied to a short-running user-generated event handler, and the lock state persisted across navigation within the tab.
Impact
An attacker could clickjack many popular websites, though the effect did not work on every site tested.
What the attacker needed
Victim uses affected Firefox; victim visits attacker page; victim clicks through the demo
How it was found
- Open the crafted HTML page.
- Click the button that starts the clickjacking demonstration.
- Wait for the target website to finish loading.
- Click the final button, which sends the mouse click to the target page.
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.
Pointer lock is a browser feature that lets a page capture the mouse, usually only after a deliberate click. Here Firefox granted it in a situation where it should not have, and then kept sending mouse clicks to that tab even after the user navigated to a different website. That means a malicious page could make a victim click buttons on another site without realising it.
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.