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

Issue 695246 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug

Blocking:
issue 695237



Sign in to add a comment

Respect X-Frame-Options and relevant CSPs for postMessage in CCT

Project Member Reported by sbirch@chromium.org, Feb 22 2017

Issue description

I believe the former is already true; wasn't sure about the latter. Just a launch-blocking tracking bug.
 

Comment 1 by yus...@chromium.org, Feb 23 2017

Labels: M-59
Sadly, for third parties, we have neither implemented yet.

Comment 2 by sbirch@chromium.org, May 24 2017

Labels: -M-59 M-60
Hey Yusuf, what's the latest on this one?

Comment 3 by yus...@chromium.org, May 24 2017

On initial investigation, this looked like already handled on lower levels (CCT uses the message port service that is the main arbiter of message ports and postMessage calls), so the low level pieces we are using should already respect these.

But I want to do a full confirmation before I close this bug.
Follow-up q: if a page is X-Frame-Options: SAMEORIGIN, do we allow postMessage iff the sender has DAL-verified as that origin?
Cc: rbyers@chromium.org
Rick, can I get some help on this? it would be a good introduction for any future strict CSP work here. I don't want to bother you too much with this so please feel free to point me to the right source/contact etc.

1) If X-Frame-Options forbids postMessage, what would be the way to check that? I wonder if it would be disabled from message_port_service directly which handled vending message ports for all cases (including app->web)
2) Sam's question. I am not very sure what it completely means if X-Frame-Options in SAMEORIGIN and what that should entail. Any pointers about that would be greatly appreciated.



Comment 6 by rbyers@chromium.org, Jul 10 2017

Cc: mkwst@chromium.org
/cc mkwst who is the expert on this stuff.  Definitely send questions his way.

Comment 7 by mkwst@chromium.org, Jul 10 2017

I don't really understand the question: `X-Frame-Options` governs the origins that can load a given page into an `<iframe>` or `<frame>` (as does the `frame-ancestors` CSP directive). It's not clear to me what relationship that has with CT. Can you clarify the scenario you're concerned about?

Comment 8 by yus...@chromium.org, Jul 10 2017

CT has added a way for the client Android app to have a postMessage channel with the tab they open. In the case where the page loaded has a X-Frame-Options set to not get any postMessage, we want the API to still honor this.

I feel like one of the causes of confusion here is that I am not really sure what that particular X-Frame-Options is. (Just that a site can declare it somehow and not get postMessages, I think? sbirch@ maybe you know more about this then I do?)

So the question is at what level this is being enforced. Basically we are creating two  MessagePorts from MessagePortService and sending one to the main frame. We are trying to understand if we have to do anything special here for the rule to be enforced.

Comment 9 by mkwst@chromium.org, Jul 11 2017

`X-Frame-Options` governs the origins that can load a given page into an `<iframe>`. `X-Frame-Options: SAMEORIGIN`, for instance, prevents `evil.com` from framing `example.com` (but would allow `example.com` to frame `example.com`).

XFO does not affect `postMessage`, except insofar as it makes it marginally more difficult to get a window handle to which messages could be posted. For example, `https://evil.com/` could call `var w = window.open('https://example.com'); w.postMessage('whatever', 'https://example.com/');` without issue (assuming they could cause the user to click in order to bypass the popup blocker.
Thanks a lot mkwst@.

sbirch@ does this address your concerns? Since we are only allowing a channel with the main frame in the API, there should be no concerns around what other frames can be or what they can do with the API (Communication with any other frames is completely at the main frame's discretion. We don't provide any additional Android/custom tabs specific hooks)

Sign in to add a comment