-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Windows 10 leaks DNS when using VPN by sending DNS to all network interfaces #22163
Comments
Please do not do this. Browser should not mess with Windows Group Policy settings for at least two reasons:
One possible solution would be to integrate a DNS client into Brave and then make that into an option (preferrably also controllable via Group Policy) so that you can choose not to use operating system DNS client. However, note that even then the DNS queries from such a built-in client can still be blocked or redirected by the firewall. For example, on my home network I already rewrite all direct DNS queries from all network devices to use the firewall's caching DNS server, which in turn uses CloudFlare DNS to resolve those queries. I believe that applications should not be adding this kind of functionality, because it is hostile to enterprise environment where it reduces visibility to network administrators (especially if said applications get compromised via extensions or other means) which will just lead to all the applications that enable and/or enforce DoH being banned. |
Those are great points, @levicki - thanks for the input 😄 The best solution IMO for solving is to configure DoH. We may try to ask users (when using VPN) to enable resolvers that aren't default in the interface and either offer a one click solution or deep link to the DoH section in settings |
@bsclifton You are welcome. Do note that if enabling DoH disables sending queries via Windows DNS client, then that could work for Brave. However, that still leaves the OS DNS requests as well as a bunch of other application DNS requests, especially those based on Electron, or Microsoft Edge WebView2 which might use built-in DNS clients with their own preferred resolvers, again circumventing the VPN. Finally, even disabling smart multi-homed resolution will only disable parallel DNS query on all network interfaces, but if DNS request fails it will still leak the query via LLMNR on all interfaces. TL;DR -- privacy on the Internet is hard, doubly so if you aren't controlling the full stack from the OS to the router. |
@spylogsster not sure if this is fixed on 1.41.33. I still see the local IP and local DNS leak through when I check on cc: @GeetaSarvadnya as she also repro'd the issue while testing on Windows. @brave/legacy_qa to try as well |
Verification
|
Brave | 1.41.91 Chromium: 103.0.5060.114 (Official Build) beta (64-bit) |
---|---|
Revision | a1c2360c5b02a6d4d6ab33796ad8a268a6128226-refs/branch-heads/5060@{#1124} |
OS | Windows 11 Version 21H2 (Build 22000.778) |
Reproduced the original issue using 1.40.113
:
Original issue
- purchase, set up, and connect to
BraveVPN
viaaccount.brave.software
using latestbeta
build (leave it open and connected) - launch latest
release
build (1.40.113
) - load browserleaks.com/dns using
release
- confirm you see "local" (ISP, i.e. non-VPN-region) DNS-server addresses being discovered
- load ipleak.net using
release
- confirm you see "local" DNS-server addresses being discovered
- switch the VPN region on
beta
to any other region - reload browserleaks.com/dns using
release
- reload ipleak.net using
release
- confirm you (still) see "local" (there might be additional ones from the connection reset) DNS-server addresses (additional protocol-layer checks using Wireshark etc. can be done)
browserleaks.com/dns |
ipleak.net |
---|---|
![]() |
![]() |
Confirm default-profile pref - PASSED
- install
1.41.91
or later - launch Brave
- open
brave://settings/security
- confirm
Use secure DNS
is toggled toON
by default - confirm the
With your current service provider
radio button is selected - confirm DNS resolution works (load any site)
IPv4 - PASSED
- purchase, set up, and connect to VPN via
account.brave.software
(development
;staging
has known issues right now) using latestbeta
build (leave it open and connected) - load
browserleaks.com/dns
usingbeta
- confirm you don't see "local" (ISP, i.e. non-VPN-region) DNS-server addresses being discovered
- load
ipleak.net
usingbeta
- confirm you see don't "local" DNS-server addresses being discovered
- switch the VPN region on
beta
to any other region - reload
browserleaks.com/dns
usingbeta
- reload
ipleak.net
usingbeta
- confirm you don't see "local" (there might be additional ones from the connection reset) DNS-server addresses (additional protocol-layer checks using Wireshark etc. can be done)
browserleaks.com/dns |
ipleak.net |
---|---|
![]() |
![]() |
Confirm Cloudflare DNS servers (via IP addresses) - PASSED
Confirm that while connected to VPN, you are using Cloudflare DNS servers, by trace-routing to their IP addresses:
λ tracert 172.70.249.120
Tracing route to 172.70.249.120 over a maximum of 30 hops
1 148 ms 148 ms 151 ms unn-212-102-43-120.cdn77.com [212.102.43.120]
2 165 ms 157 ms 149 ms unn-212-102-43-125.cdn77.com [212.102.43.125]
3 149 ms 149 ms 150 ms vl203.fra-itx7-core-1.cdn77.com [185.229.188.158]
4 149 ms 150 ms 149 ms vl1101.fra-eq5-edge-1.cdn77.com [185.229.188.13]
5 165 ms 152 ms 150 ms cloudflare-fra.cdn77.com [45.134.215.7]
6 151 ms 150 ms 150 ms 172.70.248.3
7 149 ms 150 ms 149 ms 172.70.249.120
Trace complete.
brave://settings/security
UI - PASSED
- new profile
- launch Brave
- open
brave://settings/security
- connect to
BraveVPN
usingbeta
- open
brave://settings/security
- confirm
Use secure DNS * With Cloudflare (1.1.1.1)
is chosen - confirm DNS works (and no leaks, per above tests - this can piggy-backed on them)
- disconnect
BraveVPN
- confirm
Use secure DNS * With your current service provider
is checked - confirm DNS works (not worried about leaks here, but good to double-check expectations)
brave://settings/security default |
Use secure DNS - BraveVPN ON |
Use secure DNS - BraveVPN OFF |
---|---|---|
![]() |
![]() |
![]() |
Verification
|
Brave | 1.41.91 Chromium: 103.0.5060.114 (Official Build) beta (64-bit) |
---|---|
Revision | a1c2360c5b02a6d4d6ab33796ad8a268a6128226-refs/branch-heads/5060@{#1124} |
OS | Windows 10 Version 21H2 (Build 19044.1806) |
Reproduced the original issue using 1.40.113
:
Original issue
- purchase, set up, and connect to
BraveVPN
viaaccount.brave.software
using latestbeta
build (leave it open and connected) - launch latest
release
build (1.40.113
) - load browserleaks.com/dns using
release
- confirm you see "local" (ISP, i.e. non-VPN-region) DNS-server addresses being discovered
- load ipleak.net using
release
- confirm you see "local" DNS-server addresses being discovered
- switch the VPN region on
beta
to any other region - reload browserleaks.com/dns using
release
- reload ipleak.net using
release
- confirm you (still) see "local" (there might be additional ones from the connection reset) DNS-server addresses (additional protocol-layer checks using Wireshark etc. can be done)
browserleaks.com/dns |
ipleak.net |
---|---|
![]() |
![]() |
Core setup steps (to be run before each isolated test case)
- Remove any pre-existing
BraveVPN
configs you might already have via the WindowsNetwork
applet - An
ipconfig /release
followed by anipconfig/renew
would also be good - Reboot Windows (just to be sure)
Windows VPN panel |
Remove BraveVPN config |
---|---|
![]() |
![]() |
Confirm pref default - PASSED
- install
1.41.91
or later - launch Brave
- open
brave://settings/security
- confirm
Use secure DNS
is toggled toON
by default - confirm the
With your current service provider
radio button is selected - confirm DNS resolution works (load any site)
IPv4 - PASSED
- purchase, set up, and connect to VPN via
account.brave.software
(development
;staging
has known issues right now) using latestbeta
build (leave it open and connected) - load
browserleaks.com/dns
usingbeta
- confirm you don't see "local" (ISP, i.e. non-VPN-region) DNS-server addresses being discovered
- load
ipleak.net
usingbeta
- confirm you see don't "local" DNS-server addresses being discovered
- switch the VPN region on
beta
to any other region - reload
browserleaks.com/dns
usingbeta
- reload
ipleak.net
usingbeta
- confirm you don't see "local" (there might be additional ones from the connection reset) DNS-server addresses (additional protocol-layer checks using Wireshark etc. can be done)
browserleaks.com/dns |
ipleak.net |
---|---|
![]() |
![]() |
IPv6 - PASSED
PRE-REQUISITE:
Ensure you have enabled IPv6
(in general, which DNS will also use) system-wide (hardware), on both your local ISP gateway/modem and/or your separate Wi-Fi router
- purchase, set up, and connect to VPN via
account.brave.software
(development
;staging
has known issues right now) using latestbeta
build (leave it open and connected) - load
browserleaks.com/dns
usingbeta
- confirm you don't see "local" (ISP, i.e. non-VPN-region) DNS-server addresses being discovered
- switch the VPN region on
beta
to any other region - reload
browserleaks.com/dns
usingbeta
- confirm you don't see "local" (there might be additional ones from the connection reset) DNS-server IPs listed
- confirm the DNS IP addresses listed are from Cloudflare
browserleaks.com/dns - AT&T IPv6 DNS resolvers |
browserleaks.com/dns - Cloudflare (DoH) IPv6 DNS resolvers |
---|---|
![]() |
![]() |
Confirm Cloudflare DNS servers (via IP addresses) - PASSED
Confirm that while connected to VPN, you are using Cloudflare DNS servers, by trace-routing to their IP addresses:
C:\Program Files\BraveSoftware\Brave-Browser-Beta\Application
λ tracert 172.68.209.35
Tracing route to 172.68.209.35 over a maximum of 30 hops
1 184 ms 184 ms 184 ms 145.40.109.54
2 186 ms 184 ms 185 ms 169.254.101.0
3 184 ms 184 ms 184 ms 10.253.72.62
4 186 ms 186 ms 184 ms 10.253.73.87
5 197 ms 185 ms 186 ms 10.253.73.52
6 185 ms 189 ms 203 ms 13335.syd.equinix.com [45.127.172.154]
7 199 ms 186 ms 186 ms 172.68.208.3
8 185 ms 186 ms 186 ms 172.68.209.35
Trace complete.
C:\Program Files\BraveSoftware\Brave-Browser-Beta\Application
λ nslookup 172.68.208.3
Server: one.one.one.one
Address: 1.1.1.1
*** one.one.one.one can't find 172.68.208.3: Non-existent domain
Looks like this is missing reverse DNS for the hostnames; https://1.1.1.1
is Cloudflare's DNS-resolver service.
Secure DNS
, default - PASSED
- new profile
- launch Brave
- open
brave://settings/security
- connect to
BraveVPN
usingbeta
- open
brave://settings/security
- confirm
Use secure DNS * With Cloudflare (1.1.1.1)
is chosen - confirm DNS works (and no leaks, per above tests - this can piggy-backed on them)
- disconnect
BraveVPN
- confirm
Use secure DNS * With your current service provider
is checked - confirm DNS works (not worried about leaks here, but good to double-check expectations)
brave://settings/security default |
Use secure DNS - BraveVPN ON |
Use secure DNS - BraveVPN OFF |
---|---|---|
![]() |
![]() |
![]() |
Secure DNS
, custom DoH provider - PASSED
With a working BraveVPN
setup on beta
:
- change
With Cloudflare (1.1.1.1)
toWith OpenDNS
- re-run
browserleaks.com/dns
andipleak.net
tests - confirm no ISP/"local" DNS-server IP addresses listed
- confirm they are listed as
Cisco OpenDNS, LLC
browserleaks.com/dns |
ipleak.net |
---|---|
![]() |
![]() |
Wireshark (protocol-level check, IPv4-only) - PASSED
Steps:
- launched Wireshark
- started recording traffic on the main Wi-fi adapter's interface
- typed
dns
and hit the->
to filter bydns
- ran the
browserleaks.com/dns
andipleak.net
tests from above - checked Wireshark for any local-ISP (AT&T) DNS resolver IPs (IPv4 only)
- confirmed DNS lookups were using Cloudflare's DNS-over-HTTP (DoH) (
1.1.1.1
) and domain (IPv4) DNS lookups were not exposed
1.41.91
(beta
)
browserleaks.com/dns |
ipleak.net |
---|---|
![]() |
![]() |
1.40.113
(release
)
browserleaks.com/dns |
ipleak.net |
---|---|
![]() |
![]() |
Description
See https://medium.com/@ValdikSS/beware-of-windows-10-dns-resolver-and-dns-leaks-5bc5bfb4e3f1 for more information about why the "leak" happens (it's a Windows feature called
Smart Multi-Homed Name Resolution
).Basically, Windows 10 will run multiple DNS queries (sending to multiple network interfaces) and it chooses the fastest response. Because of this behavior,
With your current service provider
) which you can view on brave://settings/securityCloudflare (1.1.1.1)
, it works as expected.Possible solutions
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\DNSClient
). If toggle is enabled, we can disableSmart Multi-Homed Name Resolution
by creating a DWORD key with the nameDisableSmartNameResolution
and a value set to anything except 0. If toggle is disabled, we can remove that valueSteps to Reproduce
VPN settings
, manually add one)Actual result:
Some DNS queries will be resolved by the ISP 🙀
Expected result:
DNS queries should ALL be resolved by the VPN
Reproduces how often:
100%
The text was updated successfully, but these errors were encountered: