[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #21280 [Core Tor/Tor]: tor-resolve: Do not truncate too long hostnames



#21280: tor-resolve: Do not truncate too long hostnames
-------------------------------------------------+-------------------------
 Reporter:  junglefowl                           |          Owner:
     Type:  defect                               |         Status:
                                                 |  needs_revision
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.0.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  0.2.9.8
 Severity:  Normal                               |     Resolution:
 Keywords:  tor-resolve, security-review,        |  Actual Points:
  029-backport                                   |
Parent ID:                                       |         Points:  0.5
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by teor):

 Replying to [comment:4 junglefowl]:
 > addrlen is already increased by 1 to contain the ending \0 character in
 the string. When its value is assigned to the unsigned char in the data
 packet, it is subtracted by one:
 >
 > (*out)[ 4 ] = (char)(uint8_t)(addrlen - 1);
 >
 > Due to this, i chose to cap at addrlen > 256 because 256-1=255 can still
 be properly put into the length byte. The ending \0 is not needed in the
 protocol, otherwise google.commm[...] would have been parsed by the remote
 peer.
 >
 > I could reduce the constant to 255. As yawning pointed out, the DNS
 lookup of the remote peer would fail anyway, but I prefer to support as
 much as the SOCKS5 protocol offers.

 Let's reduce it to UINT8_MAX then.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/21280#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs