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

Issue 644907 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug-Security



Sign in to add a comment

Security: Linking to chrome:// and file:// urls inside print preview

Reported by greencar...@hotmail.com, Sep 7 2016

Issue description

VULNERABILITY DETAILS
When you do a print preview of an html page with an anchor tag linking to chrome: urls, within the print preview you can open the link (right click->open in new tab) you end up linking to a chrome: url. 

This works for File: urls as well.

Reference:  Bug 528505 

VERSION
Chrome Version: 53.0.2785.89 m (64-bit)
Operating System: Windows 8.1

REPRODUCTION CASE
1. Go to 'data:text/html,<a href="chrome://settings">Open me</a>' (this can be served in http as well)

2. Hit CTRL+P for print preview

3. Within the print preview, right click the link and open in new tab.

4. Chrome://settings appears.
 

Comment 1 by wfh@chromium.org, Sep 7 2016

Cc: tsepez@chromium.org creis@chromium.org
Labels: Security_Severity-Low Security_Impact-Stable OS-All Pri-2
Owner: paulmeyer@chromium.org
Status: Assigned (was: Unconfirmed)
This does indeed look a lot like  issue 528505  but given the user specifically has to right click then "open in new tab" I'm inclined to give this a lower severity though.

I can repro on stable 53 and canary 55.

-> paulmeyer who landed a previous fix to this.

Comment 2 by wfh@chromium.org, Sep 7 2016

Components: UI>Browser>Navigation Internals>Plugins>PDF

Comment 3 by mea...@chromium.org, Apr 21 2017

paulmeyer: Ping. Can this use the same fixes implemented for 528505?
I'll have to look into this more. Right now I don't even know how this is working in print preview, when it is blocked in a regular PDF.
Status: Started (was: Assigned)
Okay, so now I know where these permissions are being granted:

1) Because print preview is at chrome://print/, it automatically gets access to all URLs in its own scheme (chrome://) in ChildProcessSecurityPolicyImpl::GrantRequestURL().

2) Because print preview is WebUI, it automatically gets access to all chrome:// and file:// URLs in ChildProcessSecurityPolicyImpl::GrantWebUIBindings().

Both of these mechanisms would need to be altered in order to prevent access to chrome:// URLs from print preview. It is possible that I can utilize my addition of origin-based permissions (from the last bug) to fix this. For example:

1) I could grant access only to the specific requested origin in GrantRequestURL() rather than the whole scheme.

2) I could grant access to a whitelist of chrome:// origins (like chrome://resources/ and chrome://theme/) rather than granting access to all of chrome:// in GrantWebUIBindings().

I think this could fix this bug, but I am also worried that these changes might break other things.

Comment 7 by nasko@chromium.org, May 1 2017

Cc: nick@chromium.org
Adding nick@, who also has done work on ChildProcessSecurityPolicy and granting access to resources.

Comment 8 by creis@chromium.org, May 1 2017

Cc: thestig@chromium.org
Components: UI>Browser>PrintPreview Internals>Printing
Labels: -Pri-2 Pri-1
Thanks for finding this!  This looks very concerning, and we should definitely find a way to restrict it.

thestig@: What are the reasons print preview uses WebUI and a chrome:// scheme?  We should make sure we aren't loading untrusted content directly into a privileged context.  I'm concerned what else the print preview could do if it took over the renderer process.
I'm not saying this is the way to fix this, but I figured I'd ask: why do links even need to be active in a print preview?
Cc: weili@chromium.org
Actually, I don't think I should change the permissions granted to WebUI in general, because I think it does make sense for WebUI to access anything in chrome://. I think the real problem here is that the preview is treated as WebUI at all.
Based on what weili@ mentioned in a discussion yesterday, it seems the actual PDF itself is rendered in a PPAPI process, which should not have WebUI bindings. Based on some other bugs from the past, I think the problem is that the link click generates a navigate event, which is then handled in the PPAPI embedder, which actually does have WebUI permissions (to draw the UI at least).

I think stubbing the navigation calls from the PDF plugin in the print preview WebUI wrapper should be a straightforward solution to making links do nothing in that mode. I don't see a good reason why clicking on links inside print preview should work.
Agree with what nasko@ said. What is even better is that we don't even make links clickable in print preview. It is just for preview, not for navigation/interaction, right? I think this should be a fair assumption. 

If so, I can look into how to fix this way.
BTW, for pdf files with links inside, we don't have those links clickable in print preview, which seems fine/good. :) Anyone interested can try the attached file.
tryme.pdf
45.8 KB Download
Labels: -Pri-1 Pri-2
Cc: paulmeyer@chromium.org
Components: Platform>Apps>BrowserTag
Owner: wjmaclean@chromium.org
Status: Untriaged (was: Started)
Project Member

Comment 17 by sheriffbot@chromium.org, Oct 18 2017

Status: Assigned (was: Untriaged)
Labels: -Security_Severity-Low M-65 Security_Severity-Medium
We shouldn't follow any link in Print Preview. This is important to fix. DOn't even pass any callback to the engine.
Owner: dsinclair@chromium.org
Dan, can you please take a look, this might be a simple fix.
Cc: -thestig@chromium.org dsinclair@chromium.org
Owner: thestig@chromium.org
thestig@ is this a quick change in PDFiumEngine?
Owner: hnakashima@chromium.org
Status: Started (was: Assigned)
I can take this.
Cc: hnakashima@chromium.org
Owner: rbpotter@chromium.org
Status: Fixed (was: Started)
This is actually already fixed by rbpotter@. See  crbug.com/699000 . Tested with the original repro steps, and with the .pdf provided by weili@ on #14. In print preview, the links in both cases are already not active.

Not duping as this is marked as a security bug.
Project Member

Comment 23 by sheriffbot@chromium.org, Feb 15 2018

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: reward-topanel
Labels: -Security_Severity-Medium Security_Severity-Low
Labels: -reward-topanel reward-0
I'm afraid the VRP panel declined to reward for this report, given the amount of user interaction required.
Project Member

Comment 27 by sheriffbot@chromium.org, May 24 2018

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