Mixed content bypass using window.open'd about:blank from http context and https iframe
Categories
(Core :: DOM: Security, defect, P3)
Tracking
()
People
(Reporter: 0xgodson, Assigned: jewilde)
References
(Blocks 1 open bug, )
Details
(Keywords: reporter-external, sec-low, Whiteboard: [adv-main120+][domsecurity-active][reporter-external] [client-bounty-form] [verif?])
Attachments
(3 files)
Browser used: Firefox's latest version
Hi Team,
I Just Read a disclosed Chrome Report and Seems the Same Bug affecting Firefox's Latest Version.
https://bugs.chromium.org/p/chromium/issues/detail?id=957002 (It is possible to Frame HTTP Site from HTTPS which is not allowed and it will throw a "Mixed Content" error)
Steps to Reproduce,
1 . To demonstrate the issue, you will need 2 Websites. One with HTTP and another with HTTPS.
2. From HTTPS, You need to Open a Javascript URI with
var newWin = window.open("javascript:''","_blank");
3. Then Call InnerHTML on newWin
with iframe.src as HTTP Site,
newWin.document.body.innerHTML = "<iframe src='http://testphp.vulnweb.com/login.php'>"
I have added the PoC URL and PoC.html for reference.
Thanks,
Godson
Reporter | ||
Comment 1•2 years ago
|
||
I forgot to mention that, Kindly enable Allow Popups
on HTTPS (POC Site) site
Updated•2 years ago
|
Updated•2 years ago
|
Comment 2•2 years ago
|
||
The main reason for blocking insecure iframes is that the user has no way to know if it's insecure or not. It's not otherwise dangerous on its own, and an "about:blank" page isn't making any security promises. But I'll have to try writing into the containing document -- I think you can get the URL to change to the page that writes it out. Then again, that might trigger proper mixed-content behavior
To test, make sure HTTPS-Only mode is disabled!
Comment hidden (obsolete) |
Reporter | ||
Comment 4•2 years ago
|
||
Hi Daniel, Sorry for the delayed response. I didn't manage to find any CSP bypass or sandbox bypass.
Comment 5•2 years ago
|
||
I had thought this might be related to bug 1803475 and bug 1804145, but those turned out to be specific to the CSP code. My comment 3 is likely wrong for that reason, and in addition, debug logging shows the MixedContentBlocker gets the correct context from LoadInfo:
MCBLog shouldLoad:
MCBLog - contentLocation: http://testphp.vulnweb.com/login.php
MCBLog - internalContentPolicyType: TYPE_INTERNAL_IFRAME
MCBLog - loadingPrincipal: https://random.0xgodson.com/mixed-content-bypass-r4nd0m.html
MCBLog - triggeringPrincipal: https://random.0xgodson.com/mixed-content-bypass-r4nd0m.html
MCBLog - URISafeToBeLoadedInSecureContext:
MCBLog - schemeLocal: 0
MCBLog - schemeNoReturnData: 0
MCBLog - schemeInherits: 0
MCBLog - schemeSecure: 0
... and then it exits ShouldLoad through one of the returns that does no further logging :-(
A check of the InnermostURI for a literal https: scheme looked promising, but as the logging above shows it's using the correct starting principal (not window.location
), plus it would have logged this result.
The parent document window.isSecureContext
is true
, but does TopWindowContext()
return something else?
Clearly something is going wrong here in the mixed content blocker, but I'm satisfied it's localized to this code and not a more general about:blank policy context problem that might affect more impactful checks. the sec-low
rating is appropriate.
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
Comment 8•2 years ago
|
||
This might end up fixing https://bugzilla.mozilla.org/show_bug.cgi?id=1474842, best to check again when this lands (OK if it doesn't though)
Updated•2 years ago
|
Comment 10•1 year ago
|
||
Backed out for causing mochitest plain failures on test_windowOpen.html:
https://hg.mozilla.org/integration/autoland/rev/dd0a1589ba3145eb90860df2090308b7ee4cc650
Push with failures
Failure log
dom/security/test/mixedcontentblocker/test_windowOpen.html | error thrown for failed iframe load should be from test1's iframe. - got undefined, expected "https://test1.example.com/tests/dom/security/test/mixedcontentblocker/file_windowOpen.html"
Assignee | ||
Comment 11•1 year ago
|
||
thanks Aryx! currently investigating
Assignee | ||
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Comment 13•1 year ago
•
|
||
Backed out for causing several mochitest failures:
https://hg.mozilla.org/integration/autoland/rev/3a9b1cfd0fde999b04d7f964988b768f7bfd0266
Push with failures
Failure log
dom/security/test/mixedcontentblocker/test_windowOpen.html | uncaught exception - SecurityError: Permission denied to access property "docShell" on cross-origin object at get/<@resource://testing-common/WrapPrivileged.sys.mjs:264:25
More failures:
Assignee | ||
Comment 14•1 year ago
|
||
thanks! looking now
Comment 15•1 year ago
|
||
Hey June, I think you can mark that test as skip-if xorigin
, details:
https://searchfox.org/mozilla-central/rev/fd2325f5b2a5be8f8f2acf9307285f2b7de06582/dom/security/test/csp/mochitest.ini#295
Comment 17•1 year ago
|
||
Comment 18•1 year ago
|
||
Comment 19•1 year ago
|
||
The patch landed in nightly and beta is affected.
:jewilde, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox119
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 20•1 year ago
|
||
I think this is fine to ride the trains without uplift.
If we do decide that this would be worth the hassle uplifting then we'd likely want to uplift the patch for Bug 1855588 as well
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 21•1 year ago
|
||
Updated•1 year ago
|
Reporter | ||
Comment 22•1 year ago
|
||
Hey team,
Thanks for the bounty and CVE.
If I can ask, can you please update the reporter/credit name from "0xgodson" to "Godson Bastin" on both CVE and mozilla page?
Thanks again,
Godson.
Comment 23•1 year ago
|
||
(In reply to Godson Bastin from comment #22)
Hey team,
Thanks for the bounty and CVE.If I can ask, can you please update the reporter/credit name from "0xgodson" to "Godson Bastin" on both CVE and mozilla page?
Thanks again,
Godson.
--> :tjr
Comment 24•1 year ago
|
||
- https://www.cve.org/CVERecord?id=CVE-2023-6210 (done)
- https://www.mozilla.org/en-US/security/advisories/mfsa2023-49/ (should take a couple more minutes to refresh.)
Reporter | ||
Comment 25•1 year ago
|
||
Thank You!
Comment 26•9 months ago
|
||
Bulk-unhiding security bugs fixed in Firefox 119-121 (Fall 2023). Use "moo-doctrine-subsidy" to filter
Updated•8 months ago
|
Description
•