New issue
Advanced search Search tips

Issue 865254 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Site isolation: blob URLs created by data URLs may incorrectly end up in a separate process

Project Member Reported by alex...@chromium.org, Jul 19

Issue description

What steps will reproduce the problem?
(1) Go to http://csreis.github.io/tests/cross-site-iframe.html
(2) Inspect the subframe (which is at a data URL), and run:
  var f = document.body.appendChild(document.createElement("iframe"));
  f.src = "http://www.asdf.com"
This creates a grandchild frame and navigates it to an OOPIF.
(3) Still in the middle frame, run:
  var blob = new Blob(['foo'], {type : 'text/html'}); 
  var url = URL.createObjectURL(blob);
  f.src = url;
(4) Still in the middle frame, run:
  f.contentWindow.document.body.innerText

What is the expected result?
This should output "foo".  This is what happens without --site-per-process (or rather, with --disable-site-isolation-trials)

What happens instead?
DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.  

This is because we didn't bring back the blob URL into data URL's process, even though the data URL is supposed to be able to script its own blob URL frame.  

Note that if we skipped step (2), this scripting works with and without --site-per-process.  With --site-per-process, we allow the blob URL to stay in the data URL's process due to CanSubframeSwapProcess returning false in this case, because the origin of the destination URL is unique, and we fall back to using the source SiteInstance because it isn't null (https://cs.chromium.org/chromium/src/content/browser/frame_host/render_frame_host_manager.cc?l=2559&rcl=1ca17c55c4e23840893be64e18b80518ea26da85).  But this path doesn't help if the subframe is cross-site to start with.

This seems like a very rare case and so unlikely to matter in practice, though maybe there are more cases affected here that we think.
 
Note that this doesn't seem to affect sandboxed iframes: if those create a blob URL and navigate another frame to it, the two frames can't script each other with or without site isolation.

For reference, this first came up in https://chromium-review.googlesource.com/c/chromium/src/+/1142389 and dealing with  issue 863623 , which involves blob URLs that are created from unique origins and look like "blob:null/guid".

Sign in to add a comment