allow-top-navigation-to-custom-protocols iframe sandbox bypass using sourceMappingUrls
Categories
(DevTools :: Console, defect, P3)
Tracking
(firefox-esr102 wontfix, firefox110 wontfix, firefox111 wontfix, firefox112 verified, firefox113 verified)
People
(Reporter: haxatron1, Assigned: bomsy)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
(Keywords: sec-moderate, Whiteboard: [reporter-external] [client-bounty-form] [verif?][post-critsmash-triage][adv-main112+])
Attachments
(5 files, 4 obsolete files)
Using a redirect embedded into sourceMappingUrls it is possible to navigate to external protocol links in sandboxed iframes without allow-top-navigation-to-custom-protocols, (without a user gesture even!).
- Host source-map.html and redirect.php on site 1 (attacker site), iframe.html on site 2 (victim site), as always change the URL present in the source-map.html and iframe.html files.
- Open iframe.html in victim site, external protocol dialog will launch even with allow-top-navigation-to-custom-protocols absent.
Very useful for malvertisers as it also bypasses the user gesture requirement for external protocols.
Like the previous report, I realised that for Step 2, you must open devtools console, to load the sourcemap and trigger the external protocol prompt.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 4•1 year ago
|
||
Our sourcemap implementation only checks the protocol of the sourcemap url before attempting to fetch it. So when the php redirects to another protocol, we ahve no way to check this new URL. We could completely forbid redirects when using fetch. Moving the sourcemap handling to the devtools server would also help.
Comment 5•1 year ago
|
||
Hi Daniel,
Could you help assess the priority and severity of this bug?
Assignee | ||
Comment 6•10 months ago
|
||
Hi Haxatron1,
Thanks for the files and the STR.
I tried following the steps but was not able to reproduce. it does not trigger the external protocol prompt.
Can you clarify that the victims platform should be windows?
The suggestion from Julian makes sense, we could block redirects to as a quick easy fix for this.
Reporter | ||
Comment 10•10 months ago
|
||
Hi, i've just uploaded a new set of PoCs that can be reproduced on bmoattachments. STR:
- Open the iframe.html
- Then press F12 to open Devtools, the external protocol prompt should popup asking to open ms-calculator:
Reporter | ||
Comment 11•10 months ago
|
||
And yes this reproduce on Windows (for ms-calculator: prompt). Haven't tried out other platforms yet.
Assignee | ||
Comment 12•10 months ago
|
||
Thanks for updating files. I can easily reproduce the issue.
Assignee | ||
Comment 13•10 months ago
|
||
- Block redirects on sourceMappingUrl
- Add debugger test
Updated•10 months ago
|
Assignee | ||
Comment 14•10 months ago
|
||
.sjs files depend on redirects to load static files.
In D168648 we block redirects on sourceMappingUrl, so this browser_source_map-reload.js
fails because we use .sjs to serve the content.
This patch refactors to no longer use .sjs files
Depends on D168648
Comment 15•9 months ago
|
||
https://hg.mozilla.org/mozilla-central/rev/7042ad8b36f3
https://hg.mozilla.org/mozilla-central/rev/1320da462737
Updated•9 months ago
|
Updated•8 months ago
|
Comment 16•8 months ago
|
||
Using steps in comment 10, I have reproduced this issue In Release v109.0.1 and v111.0.1 and verified the fix in Beta v112.0 (RC) and Nightly v113.0a1.
This issue could only be reproduced in Windows 10. It wouldn't reproduce in Win 7 or any others.
Updated•8 months ago
|
Comment 17•8 months ago
|
||
Updated•8 months ago
|
Updated•1 month ago
|
Description
•