[tbb-bugs] #25036 [Core Tor/Tor]: Tor 0.3.2 rejects connections to raw ipv6 addresses

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Feb 12 19:18:16 UTC 2018


#25036: Tor 0.3.2 rejects connections to raw ipv6 addresses
------------------------------------------+--------------------------------
 Reporter:  pastly                        |          Owner:  tbb-team
     Type:  defect                        |         Status:  needs_revision
 Priority:  High                          |      Milestone:  Tor:
                                          |  0.3.3.x-final
Component:  Core Tor/Tor                  |        Version:  Tor:
                                          |  0.3.2.1-alpha
 Severity:  Normal                        |     Resolution:
 Keywords:  regression ipv6 032-backport  |  Actual Points:
Parent ID:                                |         Points:
 Reviewer:                                |        Sponsor:
------------------------------------------+--------------------------------

Comment (by teor):

 Replying to [comment:21 rl1987]:
 > Replying to [comment:20 teor]:
 > > Replying to [comment:18 rl1987]:
 > > > Preliminary patch for this (and #25055):
 https://github.com/rl1987/tor/commits/bugs_25036_25055
 > >
 > > Did you replace every use of string_is_valid_hostname()?
 >
 > Yes, there were two of them in SOCKS parsing code.
 >
 > > Please add another unit test for a bracketed IPv6 address, rather than
 replacing the existing raw IPv6 address test.
 >
 > Do we want to allow IPv6 addresses without brackets? RFC2732 seems to
 require brackets in IPv6 URLs, but does not explicitly forbid bracket-less
 form.

 We can allow bracketless IPv6 without ambiguity, because the hostname and
 port are separate in the socks protocol.
 So, yes, please allow bracketless IPv6.

 > > Is tor_inet_pton() used for bracketed IPv6 strings elsewhere in the
 codebase?
 > > If not, how are they handled? Do it the same way.
 > > If so, please update the function comment on tor_inet_pton(), and add
 a unit test for tor_inet_pton() with a bracketed IPv6 address.
 >
 > In 0dda450d41b1fcfc108f1d7ee4bc3417a7494ce3 I did it the way
 `tor_addr_parse` is doing - if brackets are detected, they are stripped
 out and resulting string is passed to `tor_inet_pton`. Also I realised the
 testcase was wrong all along - it was comparing to -1.

 Thanks. These changes look good. You could call strlen() once if you
 wanted to.

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


More information about the tbb-bugs mailing list