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

Issue 750298 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 2
Type: Bug-Security
Team-Security-UX



Sign in to add a comment

Security: Spoofing with chrome://cache (Chrome icon as SecurityIndicator)

Reported by chromium...@gmail.com, Jul 28 2017

Issue description

VERSION
Chrome Version: 62.0.3170.0 (master@{#490429)
Operating System: Windows 7 and Mac

REPRODUCTION CASE
1. Open the test case.
2. Visit chrome://cache on the same tab and click quickly on "Click here" link.

This is not a dupe of  issue 748362  as mentioned in  https://crbug.com/749741#c4  since I'm still able to repro this on the lastest version of chromium (with the fix for 748362).


 
index.html
70 bytes View Download
how to repro.mp4
319 KB View Download

Comment 1 by vakh@chromium.org, Jul 28 2017

Components: UI>Browser>Navigation UI>Browser>Omnibox
Components: -UI>Browser>Omnibox UI>Browser>Omnibox>SecurityIndicators UI>Browser>WebUI
Interesting. 

The fix for 748362 was commit 7055d46ff097dedbb75bafc5e8880 which landed @490415 which appears to be just before the build in the screenshot.

I wonder if this is related to how the ViewHttpCacheJob surfaces notifications (it doesn't surface many)?

void ViewHttpCacheJob::OnStartCompleted() {
  NotifyHeadersComplete();
}

Cc: elawrence@chromium.org
Labels: OS-Mac Pri-2
Status: Untriaged (was: Unconfirmed)
Fascinating. Confirmed OS X repro on 62.0.3170.0 (Official Build) canary (64-bit)	e4aa73e1d87f2a8253311b61e479589c2d7ededa-refs/heads/master@{#490562}

Interestingly, the security indicator adopts the "green" treatment (showing both the indicator and the scheme in green). In some cases, that goes away (leaving gray for both) while in others it persists.

In terms of severity, I think this is Low at worst because it requires significant user-interaction (manually entering Chrome://cache in the omnibox while on an attacker's page) and the spoof isn't terribly exciting. But it's exciting that we can get into this busted state and we may discover inconsistencies of greater impact.
Screen Shot 2017-07-29 at 1.01.04 PM.png
201 KB View Download

Comment 5 by vakh@chromium.org, Jul 30 2017

Cc: emilyschechter@chromium.org
elawrence@,  emilyschechter@ -- this seems like a SecurityIndicators bug, more than a WebUI bug. Do you know who would be the right person to investigate this?

Comment 6 by vakh@chromium.org, Jul 30 2017

Status: Available (was: Untriaged)
Owner: elawrence@chromium.org
Status: Assigned (was: Available)
It's unquestionably an issue in the security indicator, but the indicator is fed data from lower in the stack. The WebUI node is where the last bug in the ViewCache URLRequest subclass was.

I have a few ideas about why this happens. I'll take a look. 
Internally, chrome://cache is really just a virtual URL for chrome://view-http-cache [1]. 

These steps reliably demonstrate the bug:

  1. Open the test case.
  2. Visit chrome://cache on the same tab
  3. Click quickly on "Click here" link.

In contrast, these steps don't show the bug:

  1. Open the test case.
  2. Visit chrome://view-http-cache on the same tab
  3. Click quickly on "Click here" link.

This strongly suggests that the root cause of this issue is that the virtual URL isn't getting cleared off at the expected time.

[1] https://cs.chromium.org/chromium/src/chrome/browser/browser_about_handler.cc?l=74&rcl=5a3e1a066922389f0ae4892ace98c0b6ae855d96

Comment 9 Deleted

Interesting, the omnibus always shows Chrome://cache even after navigating to another origin and back.

Enregistrement #6.mp4
638 KB View Download
Labels: OS-Windows
I'm now able to reproduce this on Windows.
Cc: -emilyschechter@chromium.org jam@chromium.org
When the NavigationHandleImpl::NavigationHandleImpl is created, it attempts to match the handle to a pending navigation entry. If the pending navigation entry has a VirtualURL, then that VirtualURL is used by the new handle, leading to the spoof. 

https://cs.chromium.org/chromium/src/content/browser/frame_host/navigation_handle_impl.cc?l=156&rcl=beb884227d7b8759c461fc6ab43effb8ad479e2e

  // Try to match this with a pending NavigationEntry if possible.
  NavigationControllerImpl* nav_controller =
      static_cast<NavigationControllerImpl*>(
          frame_tree_node_->navigator()->GetController());
  if (pending_nav_entry_id_ && nav_controller) {
    NavigationEntryImpl* nav_entry = nav_controller->GetEntryWithUniqueID(pending_nav_entry_id_);
    if (!nav_entry && nav_controller->GetPendingEntry() &&
        nav_controller->GetPendingEntry()->GetUniqueID() == pending_nav_entry_id_) {
      nav_entry = nav_controller->GetPendingEntry();
    }

At this point, we have url=="https://www.yahoo.com/" with nav_entry->GetVirtualURL() == chrome://view-http-cache/, a spoof. 

Now, why is the pending_nav_entry_id_ the same between the navigations?

(Surprisingly) In the repro we see DidStartProvisionalLoad for the *second* navigation before that of the *first* navigation.

 NavigatorImpl::DidStartProvisionalLoad https://www.yahoo.com
 NavigatorImpl::DidStartMainFrameNavigation to https://www.yahoo.com 
     [At this point has_browser_initiated_pending_entry==true with a pending_entry URL of chrome://view-http-cache/]
 NavigationHandleImpl::NavigationHandleImpl for https://www.yahoo.com pending_nav_entry_id==3
 NavigatorImpl::DidStartProvisionalLoad chrome://view-http-cache/
 NavigationHandleImpl::NavigationHandleImpl for chrome://view-http-cache/ pending_nav_entry_id==3

So, perhaps the fix here is to change NavigatorImpl::DidStartMainFrameNavigation's:

  bool has_browser_initiated_pending_entry =
      pending_entry && !pending_entry->is_renderer_initiated();

to

  bool has_browser_initiated_pending_entry =
      pending_entry && !pending_entry->is_renderer_initiated() 
      && pending_entry->GetURL() == url;

?

This seems to resolve the spoof.
Cc: csharrison@chromium.org nasko@chromium.org clamy@chromium.org creis@chromium.org
Doing URL comparisons for determining browser state usually has issues, so we should be careful before adding that.  Adding clamy@ and csharrison@, who have looked at this kind of matching between NavigationHandles and NavigationEntries before.  I can look more as well when I have moment.
Labels: Security_Severity-Low Security_Impact-Stable
Labels: Hotlist-EnamelAndFriendsFixIt
Pinging this bug. Have we had any progress on this? Do we have a better idea for what the fix should look like (particularly re: #13)?

Comment 17 by clamy@chromium.org, Feb 15 2018

Are we sure this is still happening? The mechanism for the issue described in #12 relies on pre-PlzNviagte behavior.

If it still happens post-PlzNavigate, I'm in the middle of a large refactoring of NavigationController to deal with this kind of issues. First CL for the refactoring is in review here: https://chromium-review.googlesource.com/c/chromium/src/+/904988. Our goal is to eventually remove the pending NavigationEntry in favor of using the NavigationRequest itself. 
Labels: -Hotlist-EnamelAndFriendsFixIt
Status: Fixed (was: Assigned)
chrome://cache was removed[1] in Chrome 66, so the original POC no longer exists. I wasn't able to reproduce any badness when using the similar chrome://sync as the URL instead.

I'll mark this one as FIXED given the removal of the code. If you can reproduce this using some other Chrome URL, I'm happy to reactivate.

[1] https://chromium.googlesource.com/chromium/src/+/6ebc11f6f6d112e4cca5251d4c0203e18cd79adc 
Project Member

Comment 20 by sheriffbot@chromium.org, Apr 17 2018

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: reward-topanel
Labels: -reward-topanel reward-0
I'm afraid the panel declined to reward for this one.
Project Member

Comment 23 by sheriffbot@chromium.org, Jul 24

Labels: -Restrict-View-SecurityNotify allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

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

Sign in to add a comment