requestPointerLock on iFrame src from different origin able to move the cursor out of viewport
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
People
(Reporter: sourc7, Assigned: edgar)
References
(Blocks 1 open bug)
Details
(Keywords: csectype-spoof, reporter-external, sec-moderate, Whiteboard: [reporter-external] [client-bounty-form] [verif?][secdom:pointerlock] [adv-main128+])
Attachments
(8 files, 2 obsolete files)
|
1.09 KB,
text/html
|
Details | |
|
131.91 KB,
video/mp4
|
Details | |
|
1.09 KB,
text/html
|
Details | |
|
294.41 KB,
video/mp4
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
230 bytes,
text/plain
|
Details |
After invoke requestPointerLock on iframe src from different origin, surprisingly on Fission enabled the cursor or pointer will move outside viewport including to toolbar, permission panel, desktop, taskbar, and more.
On the attached testcase I able to move user pointer to "Allow" button on permission panel, so when user double click the box, user will unaware it also click "Allow" button to allow Geolocation permission.
Tested on:
- Firefox Nightly 96.0a1 (2021-11-28) (64-bit) on Windows 11 (with screen resolution 1920x1080)
- Firefox Nightly 96.0a1 (2021-11-28) (64-bit) on Arch Linux (with screen resolution 2560x1440)
Steps to reproduce:
- Visit attached rpl-geolocation-windows.html
- Click "Launch" button
- Double click the box
- Geolocation permission is now allowed
| Reporter | ||
Comment 1•4 years ago
|
||
| Reporter | ||
Comment 2•4 years ago
|
||
Here I demonstrate I can move the cursor to the desktop, after second click the cursor will drag (steal) the desktop file back to the pointerlock area.
If dragged file is Windows shortcut .lnk by using Link Parser software it can reveal more information such as LinkCreationDate, VolumeSerialNumber, VolumeLabel, LocalBasePath, NetBIOS (Hostname), MAC Address, and more.
Steps to reproduce:
- Visit attached rpl-dragdropsteal-windows.html
- Resize the browser window (so that the left corner desktop shortcut is visible)
- Click Launch
- Double click the box
- File or folder in the desktop will dragged back to iFrame pointerlock area.
| Reporter | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
| Assignee | ||
Updated•4 years ago
|
| Assignee | ||
Updated•4 years ago
|
| Assignee | ||
Comment 4•4 years ago
|
||
We could also see this without Fission if the window is small enough, but it is much worse on Fission.
so there are two things here,
- In the current implementation, we will try to reset the mouse position to the center position of the requesting process (via synthesizing a native mousemove event), but somehow the center position of the OOP iframe is over the notification popup, which is super weird.
- Once the mouse position is outside the web content, we are unable to reset its position to "lock" mouse in a specific element.
I think we need to check 1 first, it is a Fission-specific issue.
For 2, it is a known bug, https://bugzilla.mozilla.org/show_bug.cgi?id=853160#c13 might be a proper solution.
Updated•3 years ago
|
Updated•3 years ago
|
| Assignee | ||
Comment 5•2 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #4)
- Once the mouse position is outside the web content, we are unable to reset its position to "lock" mouse in a specific element.
As a quick alternative, we could also try to set the capture content to the XULFrame in the parent document or just always redirect the mouse event to web content when pointer lock is active.
| Assignee | ||
Comment 6•2 years ago
|
||
Bug 1255338 is a more generic change which should also fix this.
| Assignee | ||
Comment 7•1 year ago
|
||
(In reply to Edgar Chen [:edgar] from comment #5)
As a quick alternative, we could also try to set the capture content to the
XULFramein the parent document or just always redirect the mouse event to web content when pointer lock is active.
On a second thought, when the permission panel (or other popup) is opened, user might expect to be able to interact with the panel. Additionally, users don't have a way to exit pointer lock without closing the popup. So I think exiting the pointer lock automatically when popup is opened has a better UX.
| Assignee | ||
Comment 8•1 year ago
|
||
| Assignee | ||
Comment 9•1 year ago
|
||
| Assignee | ||
Comment 10•1 year ago
|
||
| Assignee | ||
Comment 11•1 year ago
|
||
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Comment 13•1 year ago
|
||
Comment 14•1 year ago
|
||
Push with failures
Failure log
[task 2024-05-29T12:09:22.700Z] 12:09:22 INFO - TEST-PASS | browser/base/content/test/popupNotifications/browser_popupNotification_security_delay.js | Notification should still be open because we clicked during the security delay. -
[task 2024-05-29T12:09:22.700Z] 12:09:22 INFO - Wait for security delay to expire.
[task 2024-05-29T12:09:28.200Z] 12:09:28 INFO - Run test specific actions which restarts the security delay.
[task 2024-05-29T12:09:28.201Z] 12:09:28 INFO - Enter pointer lock
[task 2024-05-29T12:09:28.224Z] 12:09:28 INFO - Console message: [JavaScript Warning: "Request for pointer lock was denied because the browser failed to lock the pointer." {file: "https://example.com/" line: 0}]
[task 2024-05-29T12:09:55.318Z] 12:09:55 INFO - TEST-INFO | started process screentopng
[task 2024-05-29T12:09:55.519Z] 12:09:55 INFO - TEST-INFO | screentopng: exit 0
[task 2024-05-29T12:09:55.520Z] 12:09:55 INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/popupNotifications/browser_popupNotification_security_delay.js | Test timed out -
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Comment 15•1 year ago
|
||
Comment 16•1 year ago
|
||
https://hg.mozilla.org/mozilla-central/rev/809b1444b032
https://hg.mozilla.org/mozilla-central/rev/42fb9a1a6ff8
https://hg.mozilla.org/mozilla-central/rev/8d5d56cea3b8
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 17•1 year ago
|
||
Comment 18•1 year ago
|
||
Updated•1 year ago
|
Updated•10 months ago
|
Description
•