Mixed Content blocker bypass via `data:` iframe
Categories
(Core :: DOM: Security, defect, P3)
Tracking
()
People
(Reporter: bughunter.mk, Assigned: maltejur)
References
Details
(Keywords: csectype-mitigation-bypass, reporter-external, sec-low, Whiteboard: [client-bounty-form][adv-main151+][adv-esr140.11+])
Attachments
(9 files)
|
200.79 KB,
image/png
|
Details | |
|
218.35 KB,
image/png
|
Details | |
|
161.75 KB,
image/png
|
Details | |
|
924 bytes,
text/html
|
Details | |
|
115 bytes,
text/html
|
Details | |
|
85.54 KB,
image/png
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr140+
|
Details | Review |
Hi Team,
- In Firefox version 145.0.2 on macOS Tahoe 26.1, it is possible to bypass both mixed content protection and popup blockers by using a
blob:URL to inject insecure HTTP content (such as an image) within a secure HTTPS context. The content loads automatically without any user interaction, potentially leading to the exposure of malicious or insecure resources.
Proof of Concept:
- I have uploaded the proof of concept video in my drive and turned on the link sharing for your review and reference.
https://drive.google.com/file/d/1Vlyo_0VrtCdT0qdDyoZAraToCkhDj7gr/view?usp=sharing
Impact:
- Mixed Content Bypass: Insecure HTTP resources are loaded within a secure HTTPS page, potentially undermining the security of the site and compromising the user's experience.
- Popup Blocker Evasion: The attack bypasses the popup blocker, automatically opening a malicious popup without user consent.
- Security Risk: This vulnerability could be exploited to load malicious content, such as scripts, ads, or images, which can lead to phishing attacks, malware delivery, or other types of exploits.
Reproduction Steps:
-
On a secure HTTPS site (e.g.,
apple.com or openai.comoryoutube.com), open the browser console. -
Enter the following JavaScript code:
document.body.addEventListener("click", () => { const html = `<img src="http://hackerbro.net/assets/images/preload-logo.png">`; const encoded = "data:text/html," + encodeURIComponent(html); const blob = new Blob( [`<iframe src="${encoded}" style="width:100%;height:100%;border:0;"></iframe>`], { type: "text/html" } ); const url = URL.createObjectURL(blob); window.open(url); }); console.log("Click anywhere on the page to open the window."); -
Click anywhere on the page to trigger the popup.
-
A new popup opens with a
blob:URL (blob:https://www.youtube.com/...) and automatically loads an insecure HTTP image (http://hackerbro.net/assets/images/preload-logo.png), bypassing mixed content blocking.
Observed Behaviour:
- The insecure image is loaded inside the popup, despite the parent page being served over HTTPS.
- No prompt or warning is shown to the user to allow mixed content.
- The popup opens automatically, bypassing any popup blocker protections.
- The popup loads content from an HTTP URL without requiring any user interaction or consent, resulting in unintended mixed content exposure.
Expected Behaviour:
- The image (
http://hackerbro.net/assets/images/preload-logo.png) should be blocked or upgraded to HTTPS, as the parent page is loaded over HTTPS. - The popup should require user interaction to open, and the popup blocker should prevent automatic opening.
Recommendation:
- Enforce strict mixed content blocking inside
blob:anddata:URLs, preventing the loading of insecure HTTP resources. - Ensure that popups triggered in secure contexts do not automatically load content from insecure sources without user interaction.
- Strengthen popup blocker mechanisms to prevent bypass via
blob:URLs or similar schemes.
| Reporter | ||
Comment 1•10 months ago
|
||
| Reporter | ||
Comment 2•10 months ago
|
||
| Reporter | ||
Comment 3•10 months ago
|
||
This issue is referenced from Chromium Issue 40062462.
Comment 4•10 months ago
|
||
Does the same trick work if the webpage does the window opening and click event listening itself (i.e. without requiring the user to use the devtools console) ?
The popup opens automatically, bypassing any popup blocker protections.
The popup opens because the user clicks on the page. Clicks (and user interaction generally) are allowed to open popups, AFAIK also in other browsers. That isn't a bypass of the popup blocker.
Updated•10 months ago
|
| Reporter | ||
Comment 5•10 months ago
|
||
When my HTTPS page https://attacker.hackerbro.net/mixedcontent.html opens a blob: URL in the popup, the blob document inherits the HTTPS origin (blob:https://attacker.hackerbro.net/c955df87-2107-4b2c-b4dd-8044a6cde754). Inside that blob document, I include an <img> tag that loads an HTTP resource (http://hackerbro.net/...). The browser successfully loads this insecure image inside the blob—even though the top-level page and the blob URL both appear to be HTTPS. In other words, the popup shows a blob:https://… URL, but the rendered content inside it is actually pulled from an insecure HTTP source. This demonstrates that passive mixed content is permitted inside a blob document, which may look like content injection because the final rendered page appears to be fully HTTPS although it displays resources from an insecure origin.
Proof of Concept:
- I have uploaded the proof of concept video in my drive and turned on the link sharing for your review and reference.
https://drive.google.com/file/d/1Q4nBdqf690mixZq8aS6yfJmkT1Cbr4Dk/view?usp=sharing
| Reporter | ||
Comment 6•10 months ago
|
||
| Reporter | ||
Comment 7•10 months ago
|
||
Comment 8•10 months ago
|
||
(In reply to Manojkumar Jaganathan from comment #5)
Inside that blob document, I include an
<img>tag that loads an HTTP resource (http://hackerbro.net/...).
Except it doesn't because the img url redirects to an https image. This is also different from comment 0 in terms of not involving a data: iframe inside the blob URI?
Also, this is all passive mixed content (images rather than scripts).
It's not clear to me what the current state of the world is supposed to be here. Freddy, can you help? bug 1779757 is closed but https://support.mozilla.org/en-US/kb/mixed-content-blocking-firefox#w_mixed-content-is-not-blocked-not-secure says something different to what I'm reading some of the dupes/deps to suggest there.
Comment 9•9 months ago
|
||
The state of the world is that Mixed Content Is No More. Everything should be upgraded.
Looks like we "forget" we were on an HTTPS page along the way through either the popup or the blob URL.
I wonder if this is a symptom of the same issue underlying bug 1999257...
| Reporter | ||
Comment 10•7 months ago
|
||
Hi Team,
Just Checking in to see if there are any further updates available on this report.
Thank you!
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 11•7 months ago
|
||
Apologies, I think this fell under the radar a bit, as we weren't sure whether this was a duplicate of or fixed by Bug 1999257. But after Bug 1999257 having landed, I can still reproduce this, so it at least doesn't look like the exact same bug.
From what I can tell so far, we have a logic mismatch between the mixed content blocking and upgrading in this case. The mixed content blocker correctly uses the precursor principal of the loadingPrincipal (which is a nullPrincipal) and doesn't block the request because it expects it to be upgraded. But the mixed content upgrading doesn't happen at all for nullPrincipals.
| Assignee | ||
Comment 12•7 months ago
|
||
After some further investigation, this does not just seem limited to this special case with a blob URL, but seems to be a problem with mixed passive content in data: URLs in general. A more minimal example to reproduce could be an iframe like this
<!-- <img src="http://http.badssl.com/icons/icon-red.png"> -->
<iframe src="data:text/html,%3Cimg%20src%3D%22http%3A%2F%2Fhttp.badssl.com%2Ficons%2Ficon-red.png%22%3E"></iframe>
Placed on an HTTPS site, this loads http://http.badssl.com/icons/icon-red.png without being blocked or upgraded.
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Reporter | ||
Comment 13•6 months ago
|
||
Hi @Malte Jürgens, I was able to reproduce your steps. When an HTTPS site loads an iframe that contains HTTP resources (such as a logo or video), those elements are rendered as mixed content and are not automatically upgraded to HTTPS.
Attaching proof of concept image. You can also view the live PoC here: https://attacker.hackerbro.net/mixedcontenttest.html
Thank you!
| Reporter | ||
Comment 14•6 months ago
|
||
| Assignee | ||
Comment 15•6 months ago
|
||
| Assignee | ||
Comment 16•6 months ago
|
||
| Reporter | ||
Comment 17•5 months ago
|
||
| follow-up-to-spam | ||
Hi Team, just checking if this issue has been resolved. Thank you!
Comment 18•5 months ago
|
||
Comment 19•5 months ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a34356b78654
https://hg.mozilla.org/mozilla-central/rev/8b987ebba3ba
| Reporter | ||
Comment 20•5 months ago
|
||
Hi Team, good to hear the reported issue is resolved. Is this eligible for a CVE and reward? Thank you!
Updated•5 months ago
|
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 22•5 months ago
|
||
When checking if the requesting principal is potentially trustworthy for
deciding whether to upgrade mixed content, check the precursor principal in case
it exists. Otherwise, for data: URLs, the loadingPrincipal will be a
nullPrincipal, resulting in it not being potentially trustworthy, which will
lead to no upgrade happening, despite the principal originally responsible for
loading the data: URL being potentially trustworthy.
This aligns the mixed content upgrade behavior to the mixed content blocking
behavior, which is already correctly checking the precursor principal in
GetPrincipalURIOrPrecursorPrincipalURI.
Original Revision: https://phabricator.services.mozilla.com/D289176
Updated•5 months ago
|
Comment 23•5 months ago
|
||
firefox-esr140 Uplift Approval Request
- User impact if declined/Reason for urgency: ESR 140 would contain a sec-low bug that was fixed in release, which allows websites to bypass certain mixed content protections.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing: n/a
- Risk associated with taking this patch: low
- Explanation of risk level: The fix is just changing mixed content upgrading behavior and should not have any impact outside of that.
- String changes made/needed?: No
- Is Android affected?: yes
Updated•5 months ago
|
Updated•5 months ago
|
Comment 24•5 months ago
|
||
| uplift | ||
Updated•5 months ago
|
Updated•5 months ago
|
| Reporter | ||
Comment 25•5 months ago
|
||
Hi Team,
Thanks for the update and reward. Hope the CVE publication is under process.
I would like to add the following credit information for the advisory:
Manojkumar Jaganathan (https://www.linkedin.com/in/manojkumar-j-7ba35b202/) with HackerBro Technologies.
| Reporter | ||
Comment 26•5 months ago
|
||
Hi Team,
Could you please share the current status of the CVE assignment/publication for this issue?
Thank you!
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Updated•1 month ago
|
Description
•