[tor-talk] How Tor Browser changing circuits for tabs?

Matthew Finkel matthew.finkel at gmail.com
Sat Apr 27 02:41:48 UTC 2019


On Sat, Apr 27, 2019 at 12:55 AM <iwanlegit at cock.li> wrote:

> How does Tor Browser change circuits for each tabs?
>

You may find this section of the Tor Browser design document
of interest:
https://2019.www.torproject.org/projects/torbrowser/design/#identifier-linkability


>
> In Tor Browser, a circuit for tabs of Facebook is different from a
> circuit for tabs of Wikipedia for example. I checked these by:
> https://i.ibb.co/7bsRbjy/checking-circuits.jpg
>
> I thought that I could never get this behavior without modifying Tor
> Browser source code.
> So I'm searching the code: unzip-ing
> tor-browser_en-US/Browser/browser/omni.ja and grep-ing "circuit". But I
> couldn't find what I wanted. It's reckless of me.
>

> Any suggestion? If you know, parts of the code that changes circuits for
> tabs, or good documents, let me know them please.
>
>
You'll want to look at torbutton. The code for providing first-party
isolation (FPI) is part of the domain isolator (in particular
isolateCircuitsByDomain):
https://gitweb.torproject.org/torbutton.git/tree/src/components/domain-isolator.js

The circuit display is controlled by this:
https://gitweb.torproject.org/torbutton.git/tree/src/chrome/content/tor-circuit-display.js


> My guess:
> I know that it will change the circuits to send "signal NEWNYM" to Tor
> control port. May Tor Browser use the port with some commands like it
> when opening tabs?
>

NEWNYM controls the state of the entire tor process, there isn't a way to
apply NEWNYM on a single circuit or stream. The way Tor Browser controls
the connection is via SOCKS5 username and password authentication. Tor
doesn't care what values you send, but it will isolate connections that use
different usernames and passwords.

I hope this helps.


More information about the tor-talk mailing list