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

Only specify net::HostResolverSource::DNS when DoH is enabled #8279

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

darkdh
Copy link
Member

@darkdh darkdh commented Mar 17, 2021

Resolves brave/brave-browser#14755

When DoH setting is automatic or off, it should be using system resolver other than forcing it to use async resolver

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

No DoH leak

  1. Launch Brave and go to brave://settings/security
  2. Change DOH setting to secure not automatic by Screen Shot 2021-01-27 at 16 33 44
  3. Open wireshark and use dns filter and start recording
  4. Open a tab and navigate to https://tools.ietf.org/
  5. There shouldn't be any UDP dns query of tools.ietf.org in wireshark

CNAME adblock

test bellowed scenarios with

  • DoH off Screen Shot 2021-03-17 at 14 25 37

  • DoH automatic Screen Shot 2021-03-17 at 14 25 45

  • DoH on Screen Shot 2021-01-27 at 16 33 44

  1. visit https://pushbullet.com (there should be 1 request being blocked
  2. add the following custom filer via brave://adblock
||stripecdn.map.fastly.net^$important
||d2rhbqunra2aep.cloudfront.net^$important
  1. once the above custom filter has been applied, visit https://pushbullet.com (there should be 2 requests blocked)

@darkdh darkdh requested review from bbondy and antonok-edm March 17, 2021 21:27
@darkdh darkdh self-assigned this Mar 17, 2021
@darkdh darkdh requested a review from iefremov as a code owner March 17, 2021 21:27
// which will be handled by system resolver

SecureDnsConfig secure_dns_config =
SystemNetworkContextManager::GetStubResolverConfigReader()
Copy link
Collaborator

Choose a reason for hiding this comment

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

lint nit: 4 spaces

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@darkdh darkdh force-pushed the cname-adblock-doh branch from 583e420 to 9422c13 Compare March 17, 2021 21:39
@darkdh darkdh force-pushed the cname-adblock-doh branch from 9422c13 to 4537a79 Compare March 17, 2021 22:42
@darkdh
Copy link
Member Author

darkdh commented Mar 18, 2021

@kjozwiak
Copy link
Member

kjozwiak commented Mar 19, 2021

Verification PASSED on Win 10 x64 using the following build:

Brave | 1.24.6 Chromium: 89.0.4389.90 (Official Build) nightly (64-bit)
-- | --
Revision | 62eb262cdaae9ef819aadd778193781455ec7a49-refs/branch-heads/4389@{#1534}
OS | Windows 10 OS Version 2009 (Build 19042.868)

No DoH leak

Prerequisite: Followed https://wiki.wireshark.org/TLS and setup environment

Using the STR mentioned via #8279 (comment), ensured that there wasn't any DNS queries when visiting https://tools.ietf.org:

dns

CNAME adblock

DoH disabled

Disabled Without filters Filters applied
disabled shields1 shields2

DoH automatic

Automatic Without filters Filters applied
automatic shield1auto shield2auto

CloufFlare

Cloudflare Without filters Filters applied
cloud shield1Cloud shield2Cloud

OpenDNS

OpenDNS Without filters Filters applied
openDNS shield1Open shield2Open

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.

Specify resolver source breaks CNAME adblocking
6 participants