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

Fix referrer protections for frame redirects. #6674

Merged
merged 9 commits into from
Oct 23, 2020
Merged

Conversation

iefremov
Copy link
Contributor

@iefremov iefremov commented Sep 21, 2020

Fix https://github.com/brave/internal/issues/679
Fix brave/brave-browser#7933

Resolves

Submitter Checklist:

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

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@iefremov iefremov requested a review from bridiver as a code owner September 21, 2020 20:32
@iefremov iefremov requested a review from fmarier September 21, 2020 20:32
Copy link
Member

@fmarier fmarier left a comment

Choose a reason for hiding this comment

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

I assume you've tested these changes using https://referrer.fmarier.org/redirects.html?

@iefremov iefremov force-pushed the ie_referrer_redirect2 branch from 71ec0ed to b149a22 Compare September 22, 2020 07:22
@iefremov
Copy link
Contributor Author

I assume you've tested these changes using https://referrer.fmarier.org/redirects.html?

sure thing

@iefremov iefremov requested a review from fmarier September 22, 2020 11:01
method_ = redirect_info.new_method;
referrer_ = redirect_info.new_referrer;
referrer_policy_ = redirect_info.new_referrer_policy;
+ BRAVE_REDIRECT_CLEARREFERRER
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bridiver There is no way to update referrer in URLRequest (which actually sends this header to the network) via existing URLLoader/URLLoaderClient APIs , so I had to patch. An alternative was to use "extra" headers in BraveProxyingURLLoaderFactory, but earlier we decided to ban this approach due to potential negative performance implications.

@iefremov iefremov self-assigned this Sep 22, 2020
@iefremov iefremov mentioned this pull request Sep 22, 2020
32 tasks
@iefremov iefremov force-pushed the ie_referrer_redirect2 branch from 91a5ef2 to 25ebe29 Compare October 6, 2020 11:46
@iefremov iefremov requested a review from a team as a code owner October 14, 2020 12:39
@iefremov iefremov force-pushed the ie_referrer_redirect2 branch from 48832ce to f1a6da6 Compare October 14, 2020 12:52
Comment on lines 23 to 28
original_method,
redirect_info,
removed_headers,
modified_headers,
request_headers,
should_clear_upload);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Formatting looks a bit odd here.

Copy link
Collaborator

@bridiver bridiver left a comment

Choose a reason for hiding this comment

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

patches/chromium_src look ok

@iefremov iefremov force-pushed the ie_referrer_redirect2 branch from 1d2cee1 to 49cd189 Compare October 20, 2020 10:56
@iefremov iefremov force-pushed the ie_referrer_redirect2 branch from 49cd189 to 48c0a6f Compare October 21, 2020 17:29
@iefremov iefremov merged commit caf4c72 into master Oct 23, 2020
@iefremov iefremov deleted the ie_referrer_redirect2 branch October 23, 2020 11:58
@iefremov iefremov added this to the 1.18.x - Nightly milestone Oct 23, 2020
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.

Internal issue 679 (referrer)
4 participants