question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restrict custom-headers for partners

See original GitHub issue

Test plan

  • install 0.59.35 Chromium: 72.0.3626.81 (which doesn’t have the fix)
  • launch 0.59.35 using BRAVE_REFERRALS_SERVER=laptop-updates-pre.brave.com
  • visit brave.com and you should see X-Brave-Access-Key: key in the headers
  • uninstall 0.59.35 Chromium: 72.0.3626.81 & install 0.60.44 Chromium: 72.0.3626.109
  • launch 0.60.44 using BRAVE_REFERRALS_SERVER=laptop-updates-pre.brave.com
  • you shouldn’t see any X-Brave-Access-Key: headers when visiting brave.com
  • visit marketwatch.com & barrons.com and ensure you receive X-Brave-Partner: dowjones
  • visit cheddar.com and ensure that you receive x-brave-partner: cheddar
  • visit coinbase.com and ensure that you receive x-brave-partner: coinbase

Also go through the Dow Jones flow for both MW & Barrons using 0.60.44 Chromium: 72.0.3626.109 and ensure that you can redeem a promotional code and create an account.

Background

When creating the referral program, we designed it so that partners can send custom headers. The intention is so that partners can detect a user is using Brave and customize the experience for them (ex: allow them to read articles or use the service for free, etc)

An example of the headers (which are all X-Brave-Partner) can be seen here: https://laptop-updates.brave.com/promo/custom-headers

This design and implementation was originally security reviewed (and approved) by @tomlowenthal here (private repo link): https://github.com/brave/internal/issues/250#issuecomment-379076770

Description

We should restrict this list so that it can ONLY use this list for sending the X-Brave-Partner header. No custom header names should be allowed

Related

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
diracdeltascommented, Feb 12, 2019

@kjozwiak at the very least QA can test that referral promo sites like dow jones still work (same as original test plan for DJ promo)

if @aekeus adds an entry like [{"domains":["brave.com"],"headers":{"foo":"bar"},"cookieNames":[],"expiration":31536000000}] to the promo headers endpoint, then we can also test that going to brave.com does not add any extra headers.

0reactions
kjozwiakcommented, Feb 21, 2019

Verification PASSED on macOS 10.14.2 x64 using the following build:

Brave 0.60.44 Chromium: 72.0.3626.109 (Official Build) (64-bit)
Revision fae8db7ab9280fa6704a59980263c804f809ebd5-refs/branch-heads/3626@{#857}
OS Mac OS X

Verification passed on

Brave 0.60.44 Chromium: 72.0.3626.109 (Official Build) (64-bit)
Revision fae8db7ab9280fa6704a59980263c804f809ebd5-refs/branch-heads/3626@{#857}
OS Windows 7

Used test plan from https://github.com/brave/brave-browser/issues/3301#issue-408638670

Verification PASSED on Mint 19.1 x64 using the following build:

Brave 0.60.45 Chromium: 72.0.3626.109 (Official Build) (64-bit)
Revision fae8db7ab9280fa6704a59980263c804f809ebd5-refs/branch-heads/3626@{#857}
OS Linux
Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom headers - AWS Amplify Hosting
Custom HTTP headers enable you to specify headers for every HTTP response. Response headers can be used for debugging, security, and informational purposes....
Read more >
How to Add Custom Headers in ASP.NET Core Web API
In this article, we are going to learn how to add custom headers in ASP.NET Core Web API and how to enable it...
Read more >
Restricting access to Application Load Balancers - 亚马逊云科技
In the CloudFront console, use the Origin Custom Headers setting in Origin Settings. Enter the Header Name and its Value, as shown in...
Read more >
Set up a custom header - Akamai TechDocs
For example, you can use custom headers to restrict user access to only your organization's application account. You configure custom headers in a...
Read more >
Custom headers - OSIsoft Documentation
You can apply custom headers (for example, X-XSS-Protection ... same-origin Content-Security-Policy: block-all-mixed-content; default-src ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found