Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude referrer patch code when url is chrome-extension #421

Merged
merged 2 commits into from
Sep 8, 2018
Merged

Conversation

bbondy
Copy link
Member

@bbondy bbondy commented Sep 7, 2018

Fix brave/brave-browser#991

This just only runs code we patched in in one less case than it used to before. Risk should be small.
We do have referrer tests from before and they still pass.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Needed or QA/No-QA-Needed) to include the closed issue in milestone

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

@bbondy bbondy self-assigned this Sep 7, 2018
@bbondy bbondy requested a review from bridiver September 7, 2018 18:11
+ common_params_.url = last_committed_entry->GetURL();
+ // With chrome-extension by using Pocket on a page with a youtube iframe,
+ // it can lead to insecure referrer mismatch error.
+ if (!common_params_.url.SchemeIs("chrome-extension")) {
Copy link
Collaborator

@bridiver bridiver Sep 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should be checking secure/insecure schemes for all redirects? Might be other similar issues somewhere? Isn't there a referrer sanitizing method that checks that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if common_params_.url is always set or not. Otherwise I considered using GURL::SchemeIsCryptographic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a clear way directly in this patch to do it though, because in this case the url we'd overwrite to is secure, but for some reason it still fails with the extension isn't insecure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think this way is the least risky.

@bbondy bbondy force-pushed the pocket branch 2 times, most recently from cedd4f2 to 06901e4 Compare September 7, 2018 20:47
This is moved to the common network redirect so the test was meant to be removed
@bbondy
Copy link
Member Author

bbondy commented Sep 8, 2018

++'ed in slack by bridiver

@bbondy bbondy merged commit 6bdc7f1 into master Sep 8, 2018
bbondy added a commit that referenced this pull request Sep 8, 2018
Exclude referrer patch code when url is chrome-extension
@bbondy bbondy added the 0.55.x label Sep 8, 2018
@bbondy
Copy link
Member Author

bbondy commented Sep 8, 2018

0.55.x ccda442

@bsclifton bsclifton deleted the pocket branch September 26, 2018 05:44
@bbondy bbondy added this to the 0.55.x - Release milestone Jan 14, 2019
fmarier pushed a commit that referenced this pull request Oct 29, 2019
Touch overridden objective-c++ file(.mm) also
petemill pushed a commit that referenced this pull request Jul 27, 2020
Touch overridden objective-c++ file(.mm) also
petemill pushed a commit that referenced this pull request Jul 28, 2020
Touch overridden objective-c++ file(.mm) also
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pocket extension crashes
2 participants