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

Issue 622385 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug

Blocking:
issue 613260



Sign in to add a comment

[Renderer kill] RFH_CAN_COMMIT_URL_BLOCKED when trying to load Chrome Web Store in iframe (blocked by XFO)

Project Member Reported by creis@chromium.org, Jun 22 2016

Issue description

Version: 53.0.2774.3 and earlier
OS: All

What steps will reproduce the problem?
(1) Visit http://csreis.github.io/tests/cross-site-iframe.html.
(2) In DevTools, run: navFrame("https://chrome.google.com/webstore")

What is the expected output?
X-Frame-Options should prevent the navigation.

What do you see instead?
There's an X-Frame-Options error printed to the console and a blank page would be shown in the iframe, but the offending URL is sent to the browser process anyway as a commit.  This causes RenderFrameHostImpl::OnDidCommitProvisionalLoad to kill the renderer process.  (It fails the check in CanCommitURL, which solely looks to see if the CWS is committing in a non-CWS process.)

The kill was added long ago in r199881.  It's possible that the X-Frame-Options behavior has changed since then to send the offending URL in the commit message even though the page itself isn't loaded.  This seems dangerous, since the URL ends up in session history and could possibly be loaded on back/forward or session restore.

This explains a lot of the renderer kills in issue 613260, which are mixed into the same magic signature as the RFH_CAN_ACCESS_FILES_OF_PAGE_STATE kills being investigated in that bug.
 

Comment 1 by creis@chromium.org, Jun 22 2016

Owner: alex...@chromium.org
Status: Assigned (was: Available)
I'm not sure if there's something else in the commit parameters indicating the load was unsuccessful.  So far I've only noticed that validated_params.origin is unique, but otherwise it looks a lot like validated_params.url actually committed.  Importantly, validated_params.url_is_unreachable is false, so we treat it as the last successful URL and not an error page.

Alex, can you take a look at what our options are here?  It seems surprising that XFO is allowing the URL to commit.

Comment 2 by creis@chromium.org, Jun 22 2016

Blocking: 613260

Comment 3 by mkwst@chromium.org, Jun 22 2016

FWIW, I think relanding https://codereview.chromium.org/1617043002/ will probably fix this, regardless of its current implementation. That's going to be super-tough to merge back, however, so it might be worth finding a smaller, more mergable fix.

Comment 4 by creis@chromium.org, Jun 22 2016

If we can detect (in OnDidCommitProvisionalLoad) that it's a blank (error?) page committing and not the actual CWS page, we could skip the renderer kill and just rewrite the URL to about:blank for something to merge to M52.

Is there a way to detect that reliably?

I'm still worried about the implications of committing the URL, such as if it shows up within the PageState stored on the entry.  But hopefully your CL will make this moot.  Remind me, does it prevent the blocked URL from committing?

Comment 5 by mkwst@chromium.org, Jun 22 2016

> If we can detect (in OnDidCommitProvisionalLoad) that it's a blank (error?)
> page committing and not the actual CWS page, we could skip the renderer kill
> and just rewrite the URL to about:blank for something to merge to M52.
>
> Is there a way to detect that reliably?

I don't know off the top of my head. If y'all have time to look at it today, please do. If not, I'll poke at it tomorrow.

> I'm still worried about the implications of committing the URL, such as if
> it shows up within the PageState stored on the entry.  But hopefully your CL will make this moot.  Remind me, does it prevent the blocked URL from committing?

Once we re-land https://codereview.chromium.org/1617043002/, we'll end up committing to an error page, just like we do with blocks via WebRequest, etc.
Yeah, this is likely caused by my https://codereview.chromium.org/1742923002/, where I changed these blocked pages to commit an empty document instead of canceling the load.  The spec says we should pretend that we've received an empty 200 response (or go to an error page), and I guess I didn't realize that leaving the blocked URL as committed URL could have these consequences.

I guess there are a couple of short-term options.  One, we could try to change the committed URL to something else in these cases.  Currently, in cancelLoadAfterXFrameOptionsOrCSPDenied, we update DocumentLoader's response to a blank URL, but not its request, and the latter is where the committed URL comes from.

Two, we could plumb the blocked bit in FrameHostMsg_DidCommitProvisionalLoad_Params; we currently have it in DocumentLoader::wasBlockedAfterXFrameOptionsOrCSP().  

I'll see if I can get one of these working.
Project Member

Comment 7 by sheriffbot@chromium.org, Jun 23 2016

Labels: -M-52 M-53 MovedFrom-52
Moving this nonessential bug to the next milestone.

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

Comment 8 by creis@chromium.org, Jun 23 2016

Status: Started (was: Assigned)
Comment 7: We may want to merge this to M52 if it resolves the RFH_CAN_COMMIT_URL_BLOCKED crashes, since those may be frequent on M52.  We can confirm after https://codereview.chromium.org/2096453002/ lands.
Project Member

Comment 9 by bugdroid1@chromium.org, Jun 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/30535f7116c9073705a155c7cf4b0146a28f7293

commit 30535f7116c9073705a155c7cf4b0146a28f7293
Author: alexmos <alexmos@chromium.org>
Date: Thu Jun 23 18:48:23 2016

Don't commit the blocked URL when a frame is blocked by XFrameOptions.

Previously, when a load was blocked by XFO or frame-ancestors, we
committed a blank page and left the original URL as the committed URL.
In some cases, this led to the browser process thinking that the
renderer actually committed a real load for the blocked URL and
killing the renderer if that load was disallowed (e.g., for loading
Chrome Web Store in a frame).

mkwst@ is working on a CL
(https://codereview.chromium.org/1617043002/) that will ultimately fix
this by moving XFO enforcement to the browser process and committing
an error page when a load is blocked.  Until then, this is a
short-term fix to change the committed URL for the blocked (blank)
page to urlWithUniqueSecurityOrigin (data:,).

BUG= 622385 

Review-Url: https://codereview.chromium.org/2096453002
Cr-Commit-Position: refs/heads/master@{#401664}

[modify] https://crrev.com/30535f7116c9073705a155c7cf4b0146a28f7293/content/browser/site_per_process_browsertest.cc
[modify] https://crrev.com/30535f7116c9073705a155c7cf4b0146a28f7293/third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Comment 11 by creis@chromium.org, Jun 27 2016

Hmm.  There's a single report over the last few days: 63685e1600000000 in 53.0.2779.0.  (Note that the link in comment 10 shows more because it included version 53.0.2777.0, which was before the fix landed.)

That's pretty strange to me.  It suggests that there might be a URL within https://chrome.google.com/webstore that doesn't have XFO headers, which I was told shouldn't happen.  With just a single report, it could also be bad data.

If we see more of these over time, we can add a crash key for which URL it was and try to get it fixed.  I think it's probably safe to leave this closed and consider it fixed, though.  (There were 47 such kills in 53.0.2777.0, so we've certainly gotten most of them.)

Alex, do you think this is safe to merge?  I think it's a common kill on M52.
Labels: Merge-Request-52
I think it should be safe to merge.  It should hopefully fix the vast majority of these crashes in M52.

Comment 13 by dimu@google.com, Jun 27 2016

Labels: -Merge-Request-52 Merge-Approved-52 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M52 (branch: 2743)
Labels: Needs-Feedback
Tested this on Win 7/64 bit - Version 53.0.2782.0 canary (64-bit)
Please find the attached screen shot.

I am seeing the following upon running the navFrame("https://chrome.google.com/webstore") in console:

Refused to display 'https://chrome.google.com/webstore' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

Is this expected ? Please confirm the behavior.

If the above behavior is correct, please merge the CL in to M52 branch so that it gets picked up for beta promotion scheduled this thursday.
622385 on Win.PNG
40.3 KB View Download
#14: Yes, that console message is expected behavior, since the CWS page is served with X-Frame-Options.  This also used to crash the renderer, which got fixed by my CL.  I'll go ahead and merge it.
Project Member

Comment 16 by bugdroid1@chromium.org, Jun 28 2016

Labels: -merge-approved-52 merge-merged-2743
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d4a487bdca9a78e5fd9c6c149faf45a49c83d6b6

commit d4a487bdca9a78e5fd9c6c149faf45a49c83d6b6
Author: Alex Moshchuk <alexmos@chromium.org>
Date: Tue Jun 28 20:01:26 2016

Don't commit the blocked URL when a frame is blocked by XFrameOptions.

Previously, when a load was blocked by XFO or frame-ancestors, we
committed a blank page and left the original URL as the committed URL.
In some cases, this led to the browser process thinking that the
renderer actually committed a real load for the blocked URL and
killing the renderer if that load was disallowed (e.g., for loading
Chrome Web Store in a frame).

mkwst@ is working on a CL
(https://codereview.chromium.org/1617043002/) that will ultimately fix
this by moving XFO enforcement to the browser process and committing
an error page when a load is blocked.  Until then, this is a
short-term fix to change the committed URL for the blocked (blank)
page to urlWithUniqueSecurityOrigin (data:,).

BUG= 622385 

Review-Url: https://codereview.chromium.org/2096453002
Cr-Commit-Position: refs/heads/master@{#401664}
(cherry picked from commit 30535f7116c9073705a155c7cf4b0146a28f7293)

Review URL: https://codereview.chromium.org/2108873002 .

Cr-Commit-Position: refs/branch-heads/2743@{#509}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/d4a487bdca9a78e5fd9c6c149faf45a49c83d6b6/content/browser/site_per_process_browsertest.cc
[modify] https://crrev.com/d4a487bdca9a78e5fd9c6c149faf45a49c83d6b6/third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Cc: pucchakayala@chromium.org rnimmagadda@chromium.org
Labels: -Needs-Feedback TE-Verified-M52 TE-Verified-52.0.2743.60
Verified the fix on Windows 7, MAC (10.11.5) & Ubuntu Trusty (14.04) for Google Chrome Beta Version - 52.0.2743.60

Followed the steps in the comment #14

Screen-shot is attached.

TE-Verified labels are attached.
Screen Shot 2016-06-30 at 12.17.31 PM.png
95.3 KB View Download
Project Member

Comment 19 by bugdroid1@chromium.org, Feb 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5ca4b227e9d0a48b9ff8af941ff69a760305f034

commit 5ca4b227e9d0a48b9ff8af941ff69a760305f034
Author: clamy <clamy@chromium.org>
Date: Wed Feb 22 13:20:05 2017

PlzNavigate: remove NavigatorImpl::FailedNavigation

This CL removes NavigatorImpl::FailedNavigation and move its code into
its sole caller, NavigationRequest::OnRequestFailed. This makes it
easier to update the navigation url if the commit of the error page
would result in a renderer kill (see
https://codereview.chromium.org/2697713005/).

BUG= 622385 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2710643003
Cr-Commit-Position: refs/heads/master@{#452025}

[modify] https://crrev.com/5ca4b227e9d0a48b9ff8af941ff69a760305f034/content/browser/frame_host/navigation_request.cc
[modify] https://crrev.com/5ca4b227e9d0a48b9ff8af941ff69a760305f034/content/browser/frame_host/navigator.h
[modify] https://crrev.com/5ca4b227e9d0a48b9ff8af941ff69a760305f034/content/browser/frame_host/navigator_impl.cc
[modify] https://crrev.com/5ca4b227e9d0a48b9ff8af941ff69a760305f034/content/browser/frame_host/navigator_impl.h

Project Member

Comment 20 by bugdroid1@chromium.org, Feb 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4ba80de54a09324ae69bde773f194df0eec6e8b3

commit 4ba80de54a09324ae69bde773f194df0eec6e8b3
Author: arthursonzogni <arthursonzogni@chromium.org>
Date: Fri Feb 24 13:39:37 2017

DCHECK: Browser asking renderer to commit URLs it is not allowed to.

This CL adds a DCHECK when the browser ask the renderer to commit an URL
and then kill the renderer when it does.

This CL was previously related with a problem when the renderer tries to
commit an error page to the chrome webstore inside an iframe. It turns
out that there was no more problems with PlzNavigate since the
ChromeWebStore error page uses a different process.

BUG= 588314 , 622385 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2697713005
Cr-Commit-Position: refs/heads/master@{#452808}

[modify] https://crrev.com/4ba80de54a09324ae69bde773f194df0eec6e8b3/content/browser/frame_host/navigation_request.cc
[modify] https://crrev.com/4ba80de54a09324ae69bde773f194df0eec6e8b3/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/4ba80de54a09324ae69bde773f194df0eec6e8b3/content/browser/frame_host/render_frame_host_impl.h

Project Member

Comment 21 by bugdroid1@chromium.org, Mar 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cc3210aac06fd0f9437a66b6d9d784cb80b481d9

commit cc3210aac06fd0f9437a66b6d9d784cb80b481d9
Author: creis <creis@chromium.org>
Date: Tue Mar 21 19:29:41 2017

Don't reset URL for CAN_COMMIT_URL_BLOCKED renderer kill.

This is no longer necessary now that we have an early return.

BUG= 622385 
TEST=Non-blank URL in crash dumps.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2758143002
Cr-Commit-Position: refs/heads/master@{#458509}

[modify] https://crrev.com/cc3210aac06fd0f9437a66b6d9d784cb80b481d9/content/browser/frame_host/render_frame_host_impl.cc

Sign in to add a comment