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

Issue 633963 link

Starred by 17 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Regression: Error page is seen instead of pdf page after adding 'PDF viewer' extension & reload action.

Reported by rk...@etouch.net, Aug 3 2016

Issue description

Chrome Version: 53.0.2785.45 Revision 70a7d200b65a4bc8fa957bfa8a8ad8bc8f429bdb-refs/branch-heads/2785@{#477}(32/64 bit)
OS: Windows (7,8,10), Linux (14.04 LTS), Mac(10.10.5,10.11.4)

URL: https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm/related?hl=en

What steps will reproduce the problem?
(1) Launch chrome, navigate to http://www.orimi.com/pdf-test.pdf
(2) Navigate to above url and click on 'ADD TO CHROME' button 
(3) Reload the pdf page and observe.

Error page is seen instead of pdf page after reloading it.

Pdf page should load properly after reloading it.

This is a regression issue, broken in 'M-53', below is bisect info:

Good Build: 53.0.2754.0
Bad Build: 53.0.2756.0

ChangeLog Info:
https://chromium.googlesource.com/chromium/src/+log/53.0.2754.0..53.0.2756.0?pretty=fuller&n=10000

Suspecting: r397298 ?

Note: Unable to narrow down the range hence providing suspect from change log.

 
Actual_PDF.mp4
814 KB View Download
Expected_PDF.mp4
660 KB View Download
Labels: ReleaseBlock-Stable
Adding release block label, please undo if not the case.


Components: -Internals>Plugins>PDF
Labels: Needs-Bisect
Owner: ----
Status: Untriaged (was: Assigned)
Please do a "narrow bisect" and figure out why this broke.
M53 Stable launch is coming soon.Your bug is labelled as Stable ReleaseBlock, pls make sure to land the fix asap so it gets chance to bake in beta before stable promotion. Thank you.

Comment 5 by nasko@chromium.org, Aug 3 2016

Cc: asargent@chromium.org
Adding asargent@ to see if he can help. I am going to be away for non-trivial amount of time in August, so I don't know when I'll have the time to look at this issue.
BTW, I think if I reload the PDF twice, it loads up the second time. It is rather strange and it would be nice to fix. IMO this probably doesn't have to be a release blocker, because not many people switch PDF viewers like this every day, so the impact is low. Though I wonder if there are other use cases that are similiarly affected.
Status: Assigned (was: Untriaged)
@thestig: As per your comment #6, if the above issue is of low severity then do remove the blocker label. We have a M53 stable release scheduled in coming few weeks.

I really appreciate your help.


Thank you! 

Comment 8 by gov...@chromium.org, Aug 15 2016

M53 Stable launch is coming VERY soon.Your bug is labelled as Stable ReleaseBlock, pls make sure to land the fix asap so it gets chance to bake in beta before stable promotion later this month. Thank you.

Labels: -ReleaseBlock-Stable
Given this is rare case and based on comment#6 removing the stable blocker label. Please re-tag it if you think other wise.

Comment 10 by nasko@chromium.org, Aug 16 2016

The issue is that the checks in AllowCrossRendererResourceLoad disallow PageTransition that is not triggerable by the web. Even after installing the extension and just navigating in a tab, the same error is hit because the transition is TYPED | ADDRESS_BAR, which is not web triggerable. However, a reload doesn't go through AllowCrossRendererResourceLoad.

The main question is why does a top-level navigation to a PDF file result in call to AllowCrossRendererResourceLoad. I'll poke at this and post an update once I have more data.
Cc: rdevlin....@chromium.org rob@robwu.nl
+Rob FYI.

Nasko and I chatted about this a bit offline and TL;DR I do think this should be working, and that there's something we need to change in our AllowCrossRendererResourceLoad logic.

Comment 12 by nasko@chromium.org, Aug 16 2016

AllowCrossRendererResourceLoad is hit because the extension does a redirect for a request coming from regular renderer process to an extension URL.

It seems like a scenario we should support, but I need to think through the implications of allowing the redirect to go through. It might be a safe first step to just whitelist the page transition indicating omnibox navigation.

Comment 13 by nasko@chromium.org, Aug 16 2016

Status: Available (was: Assigned)
Marking the bug as available, as I will not be able to fix it in time for branch cut. If anyone else wants to take a stab at it, go ahead. 

Comment 14 by rob@robwu.nl, Aug 17 2016

Cc: nasko@chromium.org
Labels: ReleaseBlock-Stable
Owner: rob@robwu.nl
Status: Started (was: Available)
I think that it's safe to remove the transition check.

The PageTransitionIsWebTriggerable logic was introduced in  https://crbug.com/137435#c12 , and was used to disable the web_accessible_resources check for non-web transitions. In other words, it allowed any non-web-triggered transition.

71	    bool transition_allowed =
72	        !content::PageTransitionIsWebTriggerable(transition_type);
73	
74	    if (!is_empty_origin && !is_own_resource &&
75	        !is_dev_tools && !transition_allowed) {
  ....
84	      return false; // <-- Block request
85	    }
86	  }
87	
88	  return true; // <-- Allow request if not web-triggerable

Today, the check is still similar: https://chromium.googlesource.com/chromium/src/+/71331253d6537b9409518dec2368388c5d73cb94/chrome/renderer/extensions/resource_request_policy.cc#93

If we only look at the transition_allowed variable, we get this:

71	    bool transition_allowed =
72	        !content::PageTransitionIsWebTriggerable(transition_type);
75	    if (!transition_allowed)
84	      return false; // <-- Block request
88	  return true; // <-- Allow request if not web-triggerable

Inlining the variable..

75	    if (!!content::PageTransitionIsWebTriggerable(transition_type)) // <-- Note: Double negation.
84	      return false; // <-- Block request
88	  return true; // <-- Allow request if not web-triggerable

The above renderer logic was re-implemented in the browser in  https://crbug.com/173688#c14  (https://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/extensions/extension_protocols.cc?revision=192121&pathrev=192121#l309)
... except the logic is
1) put at the wrong place (i.e. before the web_accessible_resources check) and
2) inverted.

309	  if (!content::PageTransitionIsWebTriggerable(info->GetPageTransition()))
310	    return false;

If anything, the request should unconditionally be allowed if the page transition is non-web-triggered.
The only thing that stops me from unconditionally accepting the request is that in the renderer the condition is combined with 3 other variables, whose state is uncertain in the browser. So it is safer to not check for the page transition and add it back later if needed.

I am applying the RB again because the patch is underway and contrary comment 7, this is not a rare case (and luckily it has not regressed on stable yet). My extension alone amounts to a half million users who would surely notice if this hits stable.

Comment 15 by nasko@chromium.org, Aug 17 2016

Thanks Rob for the investigation. However, I'm not convinced that the check should be entirely removed. I think it is fine to move it to be the last check in that method. 
The reason is that we can't trust the renderer process for security decisions, so we need to have the browser check them as well. Moving it to the end will allow all other conditions that we know we allow to take precedence and still disallow a renderer requesting a subresource fine. Since there is already a check for main frame or subframe requests, regular navigations will be handled in that block:

92	  if (info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME) {
93	    *allowed = true;
94	    return true;
95	  } else if (info->GetResourceType() == content::RESOURCE_TYPE_SUB_FRAME) {

It doesn't make sense to allow subresources to have non-web triggerable transitions as per definition it is web content that is making the request.

Comment 16 by rob@robwu.nl, Aug 18 2016

I'll move the check to the end out of caution (for merging back), but the dissimilarity between the browser and renderer logic is very odd.

Did you have any specific reason for inverting the logic when you wrote the patch at  https://crbug.com/173688#c14 ? And if so, why did you not update the renderer-side of the check?
Please try to resolve this ASAP as we're very close to M53 Stable promotion. Please request a merge to M53 branch 2785 once change is landed/baked/verified in Canary. Thank you.
Project Member

Comment 18 by bugdroid1@chromium.org, Aug 19 2016

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

commit 45ec6fecc32bff5541c237c98228122f3252902e
Author: rob <rob@robwu.nl>
Date: Fri Aug 19 21:48:01 2016

Do not immediately block cross-renderer extension resource loads for non-web-triggered transitions

This is a very conservative fix designed to fix the regression.
The page transition logic was and is not in sync with the renderer-side check, see  https://crbug.com/633963#c14 .

BUG= 633963 
TEST=manually using steps from bug report

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

[modify] https://crrev.com/45ec6fecc32bff5541c237c98228122f3252902e/chrome/browser/extensions/chrome_url_request_util.cc
[modify] https://crrev.com/45ec6fecc32bff5541c237c98228122f3252902e/extensions/browser/url_request_util.cc

Please request a merge to M53 as soon as CL is baked/verified in Canary and safe to merge. Thank you.

Comment 20 by rob@robwu.nl, Aug 21 2016

Labels: Merge-Request-53
Confirmed fixed in 54.0.2836.0, requesting to merge 45ec6fecc32bff5541c237c98228122f3252902e.

The patch resolves the regression, but I believe that the logic can be improved (comment 14), so I will keep this open and wait until Nasko returns.

Comment 21 by dimu@chromium.org, Aug 21 2016

Labels: -Merge-Request-53 Merge-Approved-53 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M53 (branch: 2785)
Project Member

Comment 22 by bugdroid1@chromium.org, Aug 21 2016

Labels: -merge-approved-53 merge-merged-2785
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a58871cac6284a5167c1cf039127d270c8a6fb8b

commit a58871cac6284a5167c1cf039127d270c8a6fb8b
Author: Rob Wu <rob@robwu.nl>
Date: Sun Aug 21 09:54:15 2016

Do not immediately block cross-renderer extension resource loads for non-web-triggered transitions

This is a very conservative fix designed to fix the regression.
The page transition logic was and is not in sync with the renderer-side check, see  https://crbug.com/633963#c14 .

BUG= 633963 
TEST=manually using steps from bug report

Review-Url: https://codereview.chromium.org/2249423002
Cr-Commit-Position: refs/heads/master@{#413258}
(cherry picked from commit 45ec6fecc32bff5541c237c98228122f3252902e)

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

Cr-Commit-Position: refs/branch-heads/2785@{#695}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[modify] https://crrev.com/a58871cac6284a5167c1cf039127d270c8a6fb8b/chrome/browser/extensions/chrome_url_request_util.cc
[modify] https://crrev.com/a58871cac6284a5167c1cf039127d270c8a6fb8b/extensions/browser/url_request_util.cc

Cc: rnimmagadda@chromium.org
Labels: TE-Verified-M54 TE-Verified-54.0.2835.0
Verified the fix on Windows 7, MAC (10.11.6) & Ubuntu Trusty (14.04) for Google Chrome Version - 54.0.2835.0 

Screen-recording is attached.

TE-Verified labels are added.

@rob: Please change the status of this issue.

Thank you.
633963.mp4
2.1 MB View Download
Cc: blumberg@chromium.org pbomm...@chromium.org msrchandra@chromium.org pastarmovj@chromium.org
 Issue 638844  has been merged into this issue.

Comment 25 Deleted

Comment 26 by rob@robwu.nl, Aug 23 2016

Cc: japhet@chromium.org dcheng@chromium.org
 Issue 639140  has been merged into this issue.

Comment 27 by rob@robwu.nl, Aug 23 2016

Status: Fixed (was: Started)
Marking this as fixed to properly reflect the status of the regression.
See  bug 640072  for the follow-up.
Labels: TE-Verified-M53 TE-Verified-53.0.2785.80
Rechecked this issue on chrome version 53.0.2785.80 on Windows 7, Ubuntu 14.04 and MAC 10.11.6. Merge is working as intended.

No error page is displayed when refreshed the pdf page after adding the extension.

Adding TE-verified labels.

Thanks.!
Tried the bisect with the new script and was able to narrow down to a single culprit CL.

Regression Range
================
https://chromium.googlesource.com/chromium/src/+log/97a40b7bad083e7f9382a92e00adf1bd650db4a5..5cf9d45c437b7b2d899e46f2f324c147a2743eb7
Labels: hasbisect-per-revison

Sign in to add a comment