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

Expand CNAME uncloaking protection #14392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

antonok-edm
Copy link
Collaborator

@antonok-edm antonok-edm commented Jul 28, 2022

Resolves brave/brave-browser#24278

Security review: https://github.com/brave/security/issues/961

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
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • 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:

Apologies in advance for the massive test plan here, but it's a security-sensitive feature and we want to be extra sure that there is no DNS leakage before this can land in Release.

All of the following should be tested in Aggressive Shields blocking mode, and on as many OS platforms as possible. Note that many of these have already been QA tested in the past; the previous verification summaries can be used as a reference.

Android only: not all of the test plans here are applicable, but for those that are, be sure to enable the #brave-adblock-cname-uncloaking flag in brave://flags. It is currently disabled by Griffin under the DisableCnameUncloakingForAndroid study.

  1. Redo the test plan from Disable CNAME uncloaking when DoH is enabled with an HTTPS proxy #11164, but with Secure DNS both enabled and disabled
  2. Redo the test plan from Disable CNAME uncloaking when a proxy extension with a socks fallback is enabled #10742, but with Secure DNS both enabled and disabled
  3. Redo the test plan from Avoid CNAME uncloaking if a proxy is configured #8957, but with Secure DNS both enabled and disabled
  4. Redo the test plan from Only specify net::HostResolverSource::DNS when DoH is enabled #8279
  5. Redo the test plan from Fix Tor dns leak #7769

bool should_check_uncloaked =
base::FeatureList::IsEnabled(
brave_shields::features::kBraveAdblockCnameUncloaking) &&
ctx->browser_context && !ctx->browser_context->IsTor() &&
Copy link
Member

Choose a reason for hiding this comment

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

Actually we can't just remove it like this because DNS requests can't be routed through Tor connection.

  1. Tor can't be used to route UDP traffic.
  2. If we forced DoH, it will create proxy deadlock and DoH is also leaking from Tor perspective.

@iefremov
Copy link
Contributor

iefremov commented Aug 5, 2022

should we freeze the PR given the sec review outcome?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/run-network-audit Run network-audit
Projects
None yet
3 participants