New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 607795 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Page unable to access iframe with "data:" src due to cross-origin restrictions

Project Member Reported by alancutter@chromium.org, Apr 29 2016

Issue description

Test case: http://jsbin.com/mehaquboxu/edit?js,console,output

Expected:
PASS

Actual:
Error: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin \"http://null.jsbin.com\" from accessing a cross-origin frame.
    at Error (native)
    at HTMLIFrameElement.<anonymous> (mehaquboxu.js:4:9)


This behaviour in Chrome does not match Firefox.
 

Comment 1 by dcheng@chromium.org, Apr 29 2016

Cc: nick@chromium.org mkwst@chromium.org nasko@chromium.org palmer@chromium.org creis@chromium.org
Status: Available (was: Unconfirmed)
Some thoughts:

1. We don't track the initiator of a navigation, so we don't even have the right bits plumbed through to even implement this.

2. Changing this behavior might expose potential attack vectors (maybe a page assumes that it can embed arbitrary data URLs without sandboxing?)… although this is already an unsafe assumption in Firefox. So I'm not sure how bad this really will be…

3. One gain from doing this is page info could show a more useful origin. We could do this without matching the spec behavior for data: URLs, but it feels weird to me of the browser and renderer report different origins…
Could we blanket allow cross-origin access to frames sourced with the "data" protocol?

Comment 3 by mkwst@chromium.org, Apr 29 2016

> This behaviour in Chrome does not match Firefox.

It also doesn't match the spec. It does match WebKit, from which we inherited the behavior. I don't remember which way Edge chose... I'll have to look into that.

> We don't track the initiator of a navigation, so we don't even have the right bits plumbed through to even implement this.

Exactly. Implementing this correctly would be hard, and it's not clear to me that it would valuable.

> Could we blanket allow cross-origin access to frames sourced with the "data" protocol?

That would expose data from sites that are relying on either Chrome's current behavior or Firefox's current behavior (as pages that were previously cross-origin would magically become same-origin). I don't think it's something that's worth the risk.

`srcdoc` is a workaround that might be useful to you (since we do inherit origins for `<iframe srcdoc>` consistently, cross-browser).

Comment 4 by dcheng@chromium.org, Apr 29 2016

We can't to do that: the same-origin policy is a fundamental building block of web security. This would let a page embed a data: URL and abuse it as a universal XSS vector to script any other origin.
> This would let a page embed a data: URL and abuse it as a universal XSS vector to script any other origin.

Is there an example of accessing a data: document becoming a gateway to other origins or is denying it more of a precaution?

> `srcdoc` is a workaround that might be useful to you (since we do inherit origins for `<iframe srcdoc>` consistently, cross-browser).

I was not aware of this, thanks!

Comment 6 by dcheng@chromium.org, Apr 29 2016

> Is there an example of accessing a data: document
> becoming a gateway to other origins or is denying
> it more of a precaution?

Perhaps I misunderstood the original idea: my reading it's proposing any origin can access a frame with a data: URL. However, if frame A can access frame B, the reverse is also true: frame B can access frame A.

Thus, allowing this means a data: URL could access a frame with any origin, completely bypassing SOP.
> if frame A can access frame B, the reverse is also true: frame B can access frame A.

I wasn't aware access was always bidirectional, thanks for clarifying.

Comment 8 by suzyh@chromium.org, May 27 2016

Cc: -suzyh@chromium.org
Project Member

Comment 9 by sheriffbot@chromium.org, May 29 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: -palmer@chromium.org

Comment 11 by mkwst@chromium.org, Jun 19 2017

Status: WontFix (was: Untriaged)
The spec shifted to match Chrome: https://github.com/whatwg/html/pull/1756

Sign in to add a comment