brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.54k stars 2.27k forks source link

can't change exit nodes/receive new IP in Tor window #19371

Closed kjozwiak closed 2 years ago

kjozwiak commented 2 years ago

Description

With C96, users won't be able to connect to a new exit node/get a new IP address. Doing a hard refresh or running through Hamburger Menu -> New Tor connection for this site doesn't work/change the IP address.

Steps to Reproduce

  1. launch a build that has C96 (used 1.32.97 Chromium: 96.0.4664.35 in this case)
  2. launch a Tor window
  3. visit https://check.torproject.org
  4. hard refresh (notice that the IP/exit node doesn't change)
  5. try changing the exit node via Hamburger Menu -> New Tor connection for this site (nothing happens)

Actual result:

Can't connect to a new exit node/get a new IP address in Tor windows.

Expected result:

Users should be able to change exit nodes/get new IP addresses like they did in previous versions

Reproduces how often:

100% reproducible using the above STR

Brave version (brave://version info)

Brave | 1.34.3 Chromium: 96.0.4664.35 (Official Build) nightly (64-bit)
-- | --
Revision | 8df3babf8da8faa8aacb78f4848ef66a93b4944b-refs/branch-heads/4664@{#680}
OS | Windows 11 Version 21H2 (Build 22000.318)

Version/Channel Information:

Other Additional Information:

Miscellaneous Information:

CCing @diracdeltas @brave/legacy_qa @mkarolin @rebron

GeetaSarvadnya commented 2 years ago

Reproduced on Windows 10 x64 - 1.32.97

stephendonner commented 2 years ago

Looks like this is related to the SOCK5 auth rewrite in CR96; I see this in the logs from brave://tor-internals, Tor Control Events tab:

STREAM: 8 NEW 0 check.torproject.org:443 SOURCE_ADDR=127.0.0.1:53969 PURPOSE=USER SOCKS_USERNAME="torproject.org" SOCKS_PASSWORD="4771A464A547FF65676C7E0F984A2726" CLIENT_PROTOCOL=SOCKS5 NYM_EPOCH=0 SESSION_GROUP=-4 ISO_FIELDS=SOCKS_USERNAME,SOCKS_PASSWORD,CLIENTADDR,SESSION_GROUP,NYM_EPOCH STREAM: 8 SENTCONNECT 1 check.torproject.org:443 SOCKS_USERNAME="torproject.org" SOCKS_PASSWORD="4771A464A547FF65676C7E0F984A2726" CLIENT_PROTOCOL=SOCKS5 NYM_EPOCH=0 SESSION_GROUP=-4 ISO_FIELDS=SOCKS_USERNAME,SOCKS_PASSWORD,CLIENTADDR,SESSION_GROUP,NYM_EPOCH STREAM: 8 REMAP 1 116.202.120.181:443 SOURCE=EXIT SOCKS_USERNAME="torproject.org" SOCKS_PASSWORD="4771A464A547FF65676C7E0F984A2726" CLIENT_PROTOCOL=SOCKS5 NYM_EPOCH=0 SESSION_GROUP=-4 ISO_FIELDS=SOCKS_USERNAME,SOCKS_PASSWORD,CLIENTADDR,SESSION_GROUP,NYM_EPOCH STREAM: 8 SUCCEEDED 1 116.202.120.181:443 SOCKS_USERNAME="torproject.org" SOCKS_PASSWORD="4771A464A547FF65676C7E0F984A2726" CLIENT_PROTOCOL=SOCKS5 NYM_EPOCH=0 SESSION_GROUP=-4 ISO_FIELDS=SOCKS_USERNAME,SOCKS_PASSWORD,CLIENTADDR,SESSION_GROUP,NYM_EPOCH STREAM: 8 CLOSED 1 116.202.120.181:443 REASON=END REMOTE_REASON=DONE SOCKS_USERNAME="torproject.org" SOCKS_PASSWORD="4771A464A547FF65676C7E0F984A2726" CLIENT_PROTOCOL=SOCKS5 NYM_EPOCH=0 SESSION_GROUP=-4 ISO_FIELDS=SOCKS_USERNAME,SOCKS_PASSWORD,CLIENTADDR,SESSION_GROUP,NYM_EPOCH

kjozwiak commented 2 years ago

Verification PASSED on Win 11 x64 using the following build:

Brave | 1.32.103 Chromium: 96.0.4664.45 (Official Build) (64-bit)
-- | --
Revision | 76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads/4664@{#947}
OS | Windows 11 Version 21H2 (Build 22000.318)
Connecting to Tor - Logs ``` Nov 15 11:59:18.986 [notice] Tor 0.4.5.11 running on Windows 8 [or later] with Libevent 2.1.11-stable, OpenSSL 1.1.1l, Zlib 1.2.11, Liblzma N/A, Libzstd N/A and Unknown N/A as libc. Nov 15 11:59:18.986 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning Nov 15 11:59:18.987 [notice] Configuration file "C:\nonexistent" not present, using reasonable defaults. Nov 15 11:59:18.987 [warn] Path for GeoIPFile () is relative and will resolve to C:\Program Files\BraveSoftware\Brave-Browser\Application\96.1.32.103\. Is this what you wanted? Nov 15 11:59:18.987 [warn] Path for GeoIPv6File () is relative and will resolve to C:\Program Files\BraveSoftware\Brave-Browser\Application\96.1.32.103\. Is this what you wanted? Nov 15 11:59:18.988 [notice] Wow! I detected that you have 32 CPUs. I will not autodetect any more than 16, though. If you want to configure more, set NumCPUs in your torrc Nov 15 11:59:18.989 [notice] Opening Socks listener on 127.0.0.1:0 Nov 15 11:59:18.989 [notice] Socks listener listening on port 55198. Nov 15 11:59:18.989 [notice] Opened Socks listener connection (ready) on 127.0.0.1:55198 Nov 15 11:59:18.989 [notice] Opening Control listener on 127.0.0.1:0 Nov 15 11:59:18.989 [notice] Control listener listening on port 55199. Nov 15 11:59:18.989 [notice] Opened Control listener connection (ready) on 127.0.0.1:55199 [43272:31708:1115/115918.990:INFO:tor_file_watcher.cc(183)] tor: failed to open control auth cookie [43272:31708:1115/115918.990:INFO:tor_file_watcher.cc(183)] tor: failed to open control auth cookie [43272:31708:1115/115918.991:INFO:tor_file_watcher.cc(183)] tor: failed to open control auth cookie [43272:31708:1115/115918.992:INFO:tor_file_watcher.cc(183)] tor: failed to open control auth cookie [43272:31708:1115/115918.992:INFO:tor_file_watcher.cc(183)] tor: failed to open control auth cookie Nov 15 11:59:19.000 [notice] Bootstrapped 0% (starting): Starting Nov 15 11:59:19.000 [notice] Starting with guard context "default" Nov 15 11:59:19.000 [notice] New control connection opened from 127.0.0.1. Nov 15 11:59:19.000 [warn] Path for GeoIPFile () is relative and will resolve to C:\Program Files\BraveSoftware\Brave-Browser\Application\96.1.32.103\. Is this what you wanted? Nov 15 11:59:19.000 [warn] Path for GeoIPv6File () is relative and will resolve to C:\Program Files\BraveSoftware\Brave-Browser\Application\96.1.32.103\. Is this what you wanted? Nov 15 11:59:19.000 [notice] Bootstrapped 5% (conn): Connecting to a relay Nov 15 11:59:19.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay Nov 15 11:59:19.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay Nov 15 11:59:19.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done Nov 15 11:59:19.000 [notice] Bootstrapped 20% (onehop_create): Establishing an encrypted directory connection Nov 15 11:59:19.000 [notice] Bootstrapped 25% (requesting_status): Asking for networkstatus consensus Nov 15 11:59:19.000 [notice] Bootstrapped 30% (loading_status): Loading networkstatus consensus Nov 15 11:59:21.000 [notice] I learned some more directory information, but not enough to build a circuit: We have no usable consensus. Nov 15 11:59:21.000 [notice] Bootstrapped 40% (loading_keys): Loading authority key certs Nov 15 11:59:21.000 [notice] The current consensus has no exit nodes. Tor can only build internal paths, such as paths to onion services. Nov 15 11:59:21.000 [notice] Bootstrapped 45% (requesting_descriptors): Asking for relay descriptors Nov 15 11:59:21.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more microdescriptors: we have 0/6145, and can only build 0% of likely paths. (We have 0% of guards bw, 0% of midpoint bw, and 0% of end bw (no exits in consensus, using mid) = 0% of path bw.) Nov 15 11:59:22.000 [notice] Bootstrapped 50% (loading_descriptors): Loading relay descriptors Nov 15 11:59:22.000 [notice] The current consensus contains exit nodes. Tor can build exit and internal paths. Nov 15 11:59:23.000 [notice] Bootstrapped 57% (loading_descriptors): Loading relay descriptors Nov 15 11:59:23.000 [notice] Bootstrapped 62% (loading_descriptors): Loading relay descriptors Nov 15 11:59:23.000 [notice] Bootstrapped 72% (loading_descriptors): Loading relay descriptors Nov 15 11:59:23.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits Nov 15 11:59:24.000 [notice] Bootstrapped 80% (ap_conn): Connecting to a relay to build circuits Nov 15 11:59:24.000 [notice] Bootstrapped 85% (ap_conn_done): Connected to a relay to build circuits Nov 15 11:59:24.000 [notice] Bootstrapped 89% (ap_handshake): Finishing handshake with a relay to build circuits Nov 15 11:59:24.000 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits Nov 15 11:59:24.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit Nov 15 11:59:24.000 [notice] Bootstrapped 100% (done): Done ```

Verified PASSED using

Brave 1.32.103 Chromium: 96.0.4664.45 (Official Build) (x86_64)
Revision 76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads/4664@{#947}
OS macOS Version 11.6.1 (Build 20G224)
Tor logs ``` Nov 15 15:45:37.093 [notice] Tor 0.4.5.11 running on Darwin with Libevent 2.1.11-stable, OpenSSL 1.1.1l, Zlib 1.2.11, Liblzma N/A, Libzstd N/A and Unknown N/A as libc. Nov 15 15:45:37.093 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning Nov 15 15:45:37.093 [notice] Configuration file "/nonexistent" not present, using reasonable defaults. Nov 15 15:45:37.095 [notice] Opening Socks listener on 127.0.0.1:0 Nov 15 15:45:37.095 [notice] Socks listener listening on port 64648. Nov 15 15:45:37.095 [notice] Opened Socks listener connection (ready) on 127.0.0.1:64648 Nov 15 15:45:37.095 [notice] Opening Control listener on 127.0.0.1:0 Nov 15 15:45:37.095 [notice] Control listener listening on port 64649. Nov 15 15:45:37.096 [notice] Opened Control listener connection (ready) on 127.0.0.1:64649 Nov 15 15:45:37.000 [notice] Bootstrapped 0% (starting): Starting Nov 15 15:45:37.000 [notice] Starting with guard context "default" Nov 15 15:45:37.000 [notice] New control connection opened from 127.0.0.1. Nov 15 15:45:37.000 [notice] Bootstrapped 5% (conn): Connecting to a relay Nov 15 15:45:37.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay Nov 15 15:45:37.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay Nov 15 15:45:38.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done Nov 15 15:45:38.000 [notice] Bootstrapped 20% (onehop_create): Establishing an encrypted directory connection Nov 15 15:45:39.000 [notice] Bootstrapped 25% (requesting_status): Asking for networkstatus consensus Nov 15 15:45:39.000 [notice] Bootstrapped 30% (loading_status): Loading networkstatus consensus Nov 15 15:45:40.000 [notice] I learned some more directory information, but not enough to build a circuit: We have no usable consensus. Nov 15 15:45:40.000 [notice] Bootstrapped 40% (loading_keys): Loading authority key certs Nov 15 15:45:40.000 [notice] The current consensus has no exit nodes. Tor can only build internal paths, such as paths to onion services. Nov 15 15:45:40.000 [notice] Bootstrapped 45% (requesting_descriptors): Asking for relay descriptors Nov 15 15:45:40.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more microdescriptors: we have 0/6153, and can only build 0% of likely paths. (We have 0% of guards bw, 0% of midpoint bw, and 0% of end bw (no exits in consensus, using mid) = 0% of path bw.) Nov 15 15:45:41.000 [notice] Bootstrapped 50% (loading_descriptors): Loading relay descriptors Nov 15 15:45:41.000 [notice] The current consensus contains exit nodes. Tor can build exit and internal paths. Nov 15 15:45:43.000 [notice] Bootstrapped 55% (loading_descriptors): Loading relay descriptors Nov 15 15:45:50.000 [notice] Bootstrapped 62% (loading_descriptors): Loading relay descriptors Nov 15 15:45:50.000 [notice] Bootstrapped 67% (loading_descriptors): Loading relay descriptors Nov 15 15:45:50.000 [notice] Bootstrapped 73% (loading_descriptors): Loading relay descriptors Nov 15 15:45:50.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits Nov 15 15:45:51.000 [notice] Bootstrapped 80% (ap_conn): Connecting to a relay to build circuits Nov 15 15:45:51.000 [notice] Bootstrapped 85% (ap_conn_done): Connected to a relay to build circuits Nov 15 15:45:51.000 [notice] Bootstrapped 89% (ap_handshake): Finishing handshake with a relay to build circuits Nov 15 15:45:51.000 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits Nov 15 15:45:51.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit Nov 15 15:45:52.000 [notice] Bootstrapped 100% (done): Done ```