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

Issue 881184 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , iOS , Chrome , Mac , Fuchsia
Pri: 2
Type: Bug-Security



Sign in to add a comment

URL Spoof via data scheme

Reported by evi1m0.bat@gmail.com, Sep 6

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36

Steps to reproduce the problem:
1. PoC: https://server.n0tr00t.com/chrome/v69_newwindowopen.html
2. Right click of the mouse: open new window or tab

What is the expected behavior?

What went wrong?
Although JavaScript and click can't jump the data scheme, the right-click is still okay, and I think normally the right-click jump should be about: blank .

Did this work before? N/A 

Chrome version: 69.0.3497.81  Channel: stable
OS Version: OS X 10.13.5
Flash Version:
 
728a4cb1-a86a-4f97-ae5f-a49080ee4f51.png
103 KB View Download
Components: UI>Browser>Navigation
Labels: Security_Severity-Low Security_Impact-Stable OS-Android OS-Chrome OS-Fuchsia OS-iOS OS-Linux OS-Windows
Owner: mea...@chromium.org
Status: Assigned (was: Unconfirmed)
Hi! Thanks for the report. Assigning @meacer since he owned https://bugs.chromium.org/p/chromium/issues/detail?id=594215.

@meacer can you take a look and reassign if necessary?
Cc: cthomp@chromium.org emilyschechter@chromium.org
It appears @meacer is out of office now, CC'ing others.
I'll leave this assigned to meacer for now, since it's low severity. I may try to debug why the BlockedSchemeNavigationThrottle (https://cs.chromium.org/chromium/src/content/browser/frame_host/blocked_scheme_navigation_throttle.cc?l=33) isn't properly handling this case if I have some spare cycles soon.
Cc: creis@chromium.org nasko@chromium.org
Inlining the PoC, in case the actual one goes offline:

<h3>Right click of the mouse: open new window or tab</h3>
<a name="aaa" target="name" href="data://www.google.com                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ,fake google.com">

Google.com</a>
<script>

</script>

I wonder why data://www.google.com even parses as a valid URL.
This is specifically happening because right click open is considered a browser-initiated navigation, and the throttle only blocks renderer-initiated navigations:

https://cs.chromium.org/chromium/src/content/browser/frame_host/blocked_scheme_navigation_throttle.cc?l=57

If I remember right, we limited the blocking to renderer-initiated to still allow copy+pasting blocked scheme URLs into the omnibox for powerusers.
We can block the context menu ones too, NavigationHandle has an API to tell you whether it started that way: https://cs.chromium.org/chromium/src/content/public/browser/navigation_handle.h?rcl=dc36de41bc2a61aa572ea88b9746ee174ce9afeb&l=116
Comment 5: That's right.  Open Link in New Tab has generally been treated as browser-initiated (similar to copy/paste for a new URL), but that does lead to a lot of confusion and issues like this.  I'm not sure what depends on it being a browser-initiated navigation, but maybe we can look into changing it.  (If that doesn't work, we'll want to find a way to at least cover the data URL restriction for that case, but I imagine this isn't the only case where it causes problems.)

Comment 4: Not sure about the parsing question, but the same problem applies to syntactically valid data URLs as well.
Checking for context menu navigations seems like a good mitigation. Testing it locally, it behaves roughly as expected: the new tab does not load, although the URL is left in the omnibox. Are there any breakage concerns for adding that as an alternate condition (`IsRendererInitiated() || WasStartedFromContextMenu()`)?

Re: parsing, I do think that this weird case makes it particularly spoofy as it looks like "https://www.google.com" just with s/https/data/, although maybe only for people who understand schemes in the first place.


A cursory search found one possible case of breakage in Issue 845950 if we added the WasStartedFromContextMenu() check, but that seems like a minor internal use case that would still work with manual copy+paste.
I don't think we ever intended to block context menu navigations for data URLs. The goal of the blockage was to prevent drive by navigations to data URLs.

Open Link in New Tab is unlikely to happen accidentally, so I prefer not to special case it for data URLs.  (When we had Click-To-Play for plugins, we required a  right click to play the plugin because it was much less likely to be an accidental action)

Given these, I'm inclined to drop the security labels and open up this bug.
Labels: -Restrict-View-SecurityTeam allpublic
Dropping view restrictions since no one objected.
Issue 910308 has been merged into this issue.

Sign in to add a comment