[tor-bugs] #32314 [Core Tor/Tor]: Can't connect to literal IPv6 address containing double colon

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jan 21 03:56:40 UTC 2020


#32314: Can't connect to literal IPv6 address containing double colon
-------------------------------------------------+-------------------------
 Reporter:  liberat                              |          Owner:  (none)
     Type:  defect                               |         Status:
                                                 |  needs_revision
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.4.3.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  0.4.1.6
 Severity:  Normal                               |     Resolution:
 Keywords:  tor-client, tor-exit, ipv6,          |  Actual Points:  0.1
  BugSmashFund, 042-backport, 043-should         |
Parent ID:  #26664                               |         Points:  0.5
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------
Changes (by teor):

 * status:  needs_information => needs_revision
 * keywords:  tor-client, tor-exit, ipv6, BugSmashFund, check-backport
     043-should? => tor-client, tor-exit, ipv6, BugSmashFund, 042-backport,
     043-should


Comment:

 Looking at the tests from #30721, Tor now expects square brackets for
 ambiguous IPv6 cases:
 {{{
   /* And this is an ambiguous case, which is interpreted as an IPv6
 address. */
   TEST_ADDR_V6_PARSE_CANONICAL("11:22::88:99", 0);
   /* Use square brackets to resolve the ambiguity */
   TEST_ADDR_V6_PARSE_CANONICAL("[11:22::88:99]", 1);
   TEST_ADDR_V6_PORT_PARSE("[11:22::88]:99",
                            "11:22::88",99);
 }}}
 https://github.com/torproject/tor/pull/1068/files#diff-
 048243cd6d9ed36dda0944181d8ec8abR1285

 So it looks like this issue still happens in Tor 0.4.2.

 We should make sure that an ambiguous IPv6 address always has square
 brackets, as soon as it is parsed by the client, and whenever it's sent
 via the Tor protocol.

 We could handle ambiguous cases at the exit using the previous behaviour.
 (Assume IPv6 with a default port.)

 We can make exceptions for client and exit code, but we should not allow
 ambiguous addresses in other code. (For example: config code, directory
 document parsing code.)

 Who wants to turn these patches into a pull request?
 * https://trac.torproject.org/projects/tor/ticket/32314#comment:1
 * a similar fix that canonicalises MapAddress config and request parsing
 * a fix for exits that canonicalises IPv6 addresses
   * the simplest way to fix this issue is to try parsing as an address
 first, then try parsing as an address and port

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/32314#comment:11>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list