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

Issue 650332 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Recursive iframe checks broken in OOPIF

Project Member Reported by dcheng@chromium.org, Sep 26 2016

Issue description

https://chromium.googlesource.com/chromium/src/+/adba2165f4c6e1c7d4a78179d6e066aa8e37f938/third_party/WebKit/Source/core/frame/LocalFrame.cpp#740 is the check to enforce this. This doesn't work in an A embeds B embeds A embeds B scenario.

Incidentally, this appears to crash canary: https://crash.corp.google.com/browse?q=reportid=%2738ae262d00000000%27.

(R-V-G for now, since it crashes stuff)
 

Comment 1 by creis@chromium.org, Sep 26 2016

Cc: creis@chromium.org japhet@chromium.org dcheng@chromium.org
Components: UI>Browser>Navigation Blink>HTML>IFrame
Nice find.  What happens in Blink when this check fails?  I'm wondering if it's something the browser process could do instead.

Also, why isn't it working?  All the A frames will be in the same process, so won't they see each other?  (The loop skips RemoteFrames and continues walking up the tree, rather than early returning.)

Comment 2 by dcheng@chromium.org, Sep 26 2016

The check is done at the HTMLFrameElement level. So in B, it never sees the self-referential URLs in its ancestors, since those are live off in A. But then when we swap to A, we don't do the self-referential check anymore, so we happily load it.

I briefly talked to Nasko about this as well, and it sounds like maybe we could do something similar to CSP blocking. Blocked self-referential iframes behave pretty weirdly today, so we should normalize their behavior anyway. There might also be other ways to bypass it
Cc: alex...@chromium.org
Labels: OS-All
Owner: davidsac@chromium.org
Status: Assigned (was: Available)
Assigning to Andrew, who will look into fixing this.  It seems there are other cases that aren't handled by the existing check in LocalFrame::isURLAllowed today (such as when the iframe navigates itself via location.href).  We should be able to fix them all by moving that check to happen in the browser process and canceling the load there.

Comment 4 by dcheng@chromium.org, Nov 23 2016

Labels: -Restrict-View-Google
Project Member

Comment 5 by bugdroid1@chromium.org, Feb 15 2017

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

commit 04fdd09f342badeb2af3a639d62a4da65d4baaa1
Author: davidsac <davidsac@chromium.org>
Date: Wed Feb 15 17:05:55 2017

Fix infinite loop of frames being created when one or more frames
contain nested IFrames to one another.

To reproduce this issue, run Chrome in site-per-process mode and visit
either http://dudeguy409.github.io/coreferencingframe1 or
https://davidsac.github.io/coreferencingframe2.html.

The current check refuses to load a URL if any two ancestors in the
frame tree have the same URL. It is currently inadequate for two
reasons:

1) This doesn't work for OOPIFs.  If the parent frames are in a
different process, they will be remote frames which don't have URLs,
so the check is simply skipped.

(2) it's only applied in a subset of cases and doesn't handle
redirects, for example.

To fix these issues, this CL moves these checks to the browser
process, where it's applied inside NavigationHandleImpl any time a
request is started or a redirect is received.

BUG= 650332 ,  527367 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

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

[modify] https://crrev.com/04fdd09f342badeb2af3a639d62a4da65d4baaa1/content/browser/frame_host/navigation_handle_impl.cc
[modify] https://crrev.com/04fdd09f342badeb2af3a639d62a4da65d4baaa1/content/browser/frame_host/navigation_handle_impl.h
[modify] https://crrev.com/04fdd09f342badeb2af3a639d62a4da65d4baaa1/content/browser/frame_host/render_frame_host_manager_browsertest.cc
[add] https://crrev.com/04fdd09f342badeb2af3a639d62a4da65d4baaa1/content/test/data/coreferencingframe_1.html
[add] https://crrev.com/04fdd09f342badeb2af3a639d62a4da65d4baaa1/content/test/data/coreferencingframe_2.html
[add] https://crrev.com/04fdd09f342badeb2af3a639d62a4da65d4baaa1/content/test/data/page_with_meta_refresh_frame.html
[modify] https://crrev.com/04fdd09f342badeb2af3a639d62a4da65d4baaa1/third_party/WebKit/Source/core/frame/LocalFrame.cpp
[modify] https://crrev.com/04fdd09f342badeb2af3a639d62a4da65d4baaa1/third_party/WebKit/Source/core/frame/LocalFrame.h
[modify] https://crrev.com/04fdd09f342badeb2af3a639d62a4da65d4baaa1/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
[modify] https://crrev.com/04fdd09f342badeb2af3a639d62a4da65d4baaa1/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment