Applications that do not implement the Tor
protocol SHOULD generate an error upon the use of .onion and
SHOULD NOT perform a DNS lookup.
I hear that Firefox implemented this feature, so if you try to visit an onion address in Firefox, it refuses to try. There's an about:config way to disable that feature -- and in theory it allow it if the browser is sending the traffic into Tor, and how exactly it knows that...this gets complicated.
So the vision of this ticket is to keep track of which applications have implemented this change (and how they did it), and which apps have tickets for implementing it (and how they propose to do it).
Then we can look for patterns and figure out:
if there's advice we can provide for how best to achieve the goal in the RFC (like "don't change your app, and instead get the change into the resolver that your app uses"), and also
if there are particular external pieces of software we should open tickets for changing.
Sorry Gus that I put this in the community team's list. I spent a long time looking at other gitlab components and couldn't find one that fit. This is definitely a topic that falls into the cracks between teams -- please help us find a home for it. :)
@jnewsome was wondering how this idea interacts with torsocks, and in theory they can go well together: the application calls gethostbyname without knowing or caring about onion addresses, and then either
gethostbyname asks the system resolver, which says "oh that's an onion address, not gonna send that hostname out onto the network, here's your nxdomain", or
torsocks hooks and replaces gethostbyname, and then torsocks does whatever it sees fit, e.g. providing a local virtual address and then informing Tor about what hostname that address really corresponds to.
So in that sense we really don't want each application to learn that onion addresses are special, because if the application had its own logic before it calls gethostbyname, then torsocks has to get in on hooking that too.
It seems like part of what gets messy here is the "don't resolve it unless you're sending your traffic through Tor", so applications that are Tor-aware should be doing something different, and maybe we should provide guidelines for how they should be doing that, else we'll get ten different contradictory approaches in the wild.
A resolver that doesn't recognize a .onion address as special will try to resolve it over the network via the DNS protocol, leaking that the user tried to access the given .onion address to the root domain server and to anyone else on the network who observes the request. https://www.verisign.com/assets/onionleakage.pdf?inc=www.verisigninc.com
In the past this has resulted in chrome leaking .onion addresses.
Fixing this would also provide defense-in-depth against bugs like tpo/core/torsocks#11727. In that bug a user who uses torsocks with irssi to access a .onion address will leak the address. (Work in torsocks and/or irssi is needed for .onion addresses to work correctly, but a local DNS resolver that recognized the .onion address and blocked the request would at least prevent leaking the address).
Another topic we discussed is potentially implementing the behavior in libraries, such as libc's gethostname or libevent's resolver api. This would likely be beneficial, e.g. in cases where the first-level resolver service isn't on the local host, or that resolver doesn't already implement this behavior.
This might be a little bit harder of a sell though since, e.g., gethostname arguably has no business recognizing resolver special cases before passing it to a real resolver service.
Also as Roger noted above though, we need to be careful to not advocate that applications block .onion addresses (or at least that the behavior can be disabled), since that would interfere with torsocks's ability to torify that application.
Shall we change the ticket to, instead of just advocating non-resolution, support RFC 7686 by either use Tor and resolving .onion addresses (like link previous from .onion sites through Signal), or refusing to resolve .onion domains (so they're not leaked in the DNS)?
This can be a better message to give, and could increase support for Tor.