Force PointerLock to Remain on Locked State even "escape" Key Pressed (able to trick user to press another combination to escape)
A crafted page could keep the pointer locked even after the user pressed the escape key, and could overlap a Firefox permission dialog with a spoofed validity message. An attacker could then trick the user into pressing a key combination that both released the pointer and accepted the permission request.
Originally disclosed on Mozilla
- Fixed in 3.3 years
- Paid in 13 months
- Disclosed after 3.3 years
Created attachment 9204964 pointerlock+validitymessage.html
By setting CSS property to display then create a Blob canvas object, afterward set the callback parameter to element.onselectstart to call theelement.requestPointerLock() function, when user double-click the element the cursor will remain locked on the target element even if the user presses the "escape" key (default unlock gesture) to unlock the pointer.
I also found that it is possible to overlap the Firefox WebExtension install dialog or permission request dialog using the select element custom validity message.
Therefore when user unable to unlock the pointer, the attacker can show spoof message "Press Alt+A" to unlock the pointer, after user presses the combination key, the pointer will unlocked and user also unconsciously pressed combination key to allow the extension install or permission request.
Version affected:
- Firefox Nightly 88.0a1 (2021-02-23) (64-bit)
- Firefox Release 86.0 (64-bit)
- Firefox ESR 78.8.0esr (64-bit)
Steps to Reproduce:
- Visit attached pointerlock+validitymessage.html
- Double click the instruction text
- Press "escape" key repeatedly to test whether user able to unlock the pointer
- After ~4s permission request dialog will appear, afterward the
selectcustom validity message will also appear to overlap the dialog - Press "Alt+A" to take back control
- Notification permission are allowed and the pointer is now unlocked
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 logic flaw where re-requesting pointer lock from within a selectstart callback re-locks the pointer after the escape gesture, combined with a select element's custom validity message being drawn over a browser dialog.
Impact
An attacker could keep the pointer locked and trick the user into pressing a combination that approves an extension install or permission request, though the report only demonstrates this on Firefox.
What the attacker needed
Victim visits a crafted page; victim double-clicks the element; Firefox browser
How it was found
- Open the attached test page.
- Double-click the instruction text to trigger the lock.
- Press escape repeatedly to check whether the pointer unlocks.
- Wait about four seconds for the permission request dialog, then the validity message overlaps it.
- Press the suggested key combination to regain control.
- The notification permission is granted and the pointer is released.
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 web page captures your mouse pointer, the browser normally lets you press Escape to get it back. This report shows a page could stop that from working and then show a fake message telling you to press a key combination, which also approved a browser permission prompt you could not see properly.
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.