RESOLVED FIXED 170075
Cannot read blobs in sandboxed iframes
https://bugs.webkit.org/show_bug.cgi?id=170075
Summary Cannot read blobs in sandboxed iframes
Jimmy Wärting
Reported 2017-03-24 14:23:44 PDT
Blobs can't be read in sandboxed iframes with allow-scripts "[blocked] The page at https://jsfiddle.net/bgh27rre/1/ was not allowed to display insecure content from blob:null/39cc8f5e-0ff2-4435-8e82-eedb3ce3091c." https://jsfiddle.net/bgh27rre/1/ https://github.com/Fyrd/caniuse/issues/3266 https://github.com/github/fetch/issues/481
Attachments
test case (2.08 KB, text/html)
2020-09-16 11:46 PDT, Tim Guan-tin Chien [:timdream]
no flags
Patch (6.21 KB, patch)
2021-03-02 05:35 PST, youenn fablet
no flags
Patch (8.57 KB, patch)
2021-03-02 10:15 PST, youenn fablet
no flags
Jimmy Wärting
Comment 1 2017-03-25 09:31:27 PDT
Only apply to secure pages (https)
Radar WebKit Bug Importer
Comment 2 2017-03-27 14:17:57 PDT
John Firebaugh
Comment 3 2018-02-27 15:26:29 PST
This effectively prevents the use of web workers within <iframe sandbox="allow-scripts">: 1. Initializing the Worker with a blob URI doesn't work due to this bug. 2. Initializing the Worker with a http[s] URI doesn't work because without allow-same-origin, the iframe has a null origin, and Worker scripts are required to be same-origin. 3. WebKit does not support initializing the Worker with a data URI.
Adam Podolnick
Comment 4 2019-04-11 13:01:29 PDT
This is still an issue in Safari 12.1 on Mojave.
Kallyn Gowdy
Comment 5 2019-06-28 17:29:15 PDT
This is also an issue in Mobile Safari on iOS 12.3.1. A workaround is to add the allow-same-origin option to the sandbox attribute, but as stated in the spec (http://w3c.github.io/html/semantics-embedded-content.html#element-attrdef-iframe-sandbox), this defeats the purpose of using the sandbox attribute.
Tim Guan-tin Chien [:timdream]
Comment 6 2020-09-16 11:46:06 PDT
Created attachment 408940 [details] test case Made a demo and was going to file, but based on comment 3 this is already filed.
youenn fablet
Comment 7 2021-03-01 07:09:16 PST
Right, the issue is that the blob URL is something like blob://null/UUID so is considered "Not TrustedWorthy". Chrome and Firefox seems to be treating it as trustworthy, probably because the context that created the blob is secure context. I filed https://github.com/w3c/webappsec-mixed-content/issues/41 to clarify this since the specs are not super clear to me.
youenn fablet
Comment 8 2021-03-02 05:35:19 PST
youenn fablet
Comment 9 2021-03-02 10:15:11 PST
Jimmy Wärting
Comment 10 2021-03-02 12:07:21 PST
I almost forgot. I have a new similar issue. Maybe it will get resolved in same patch but here is another test case The top (secure) page sends a blob that have been generated and wants a sandboxed iframe to execute it safely. This is also not possible in safari, but works in other browsers. My current solution is to create a script with text content instead... This kind of blob should be flagged as secure? so even if the iframe acted as secure or not it should still run it either way since this blob is made from a secure origin? Demo https://jsfiddle.net/ekraqvw1/ the xhr.responseType = 'blob' problem in iframes is long forgotten - but still a issue
youenn fablet
Comment 11 2021-03-03 00:03:37 PST
(In reply to Jimmy Wärting from comment #10) > I almost forgot. > I have a new similar issue. Maybe it will get resolved in same patch but > here is another test case > > The top (secure) page sends a blob that have been generated and wants a > sandboxed iframe to execute it safely. > This is also not possible in safari, but works in other browsers. My current > solution is to create a script with text content instead... > > This kind of blob should be flagged as secure? so even if the iframe acted > as secure or not it should still run it either way since this blob is made > from a secure origin? > > Demo https://jsfiddle.net/ekraqvw1/ This is most probably the same issue.
EWS
Comment 12 2021-03-04 01:32:17 PST
Committed r273879: <https://commits.webkit.org/r273879> All reviewed patches have been landed. Closing bug and clearing flags on attachment 421960 [details].
Aleksandr Dobkin
Comment 13 2021-08-30 12:01:55 PDT
The demo (https://jsfiddle.net/bgh27rre/1/) continues to reproduce iOS Safari 14.7.1. Can you confirm when the fix will land?
Note You need to log in before you can comment on or make changes to this bug.