[tor-bugs] #32315 [Core Tor/Tor]: Can't perform reverse DNS lookup for a (binary) IPv6 address

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Nov 2 19:35:53 UTC 2019


#32315: Can't perform reverse DNS lookup for a (binary) IPv6 address
--------------------------+------------------------------
 Reporter:  liberat       |          Owner:  (none)
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:
Component:  Core Tor/Tor  |        Version:  Tor: 0.4.1.6
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+------------------------------

Comment (by liberat):

 This seems to be straightforward to fix:
 {{{
 --- a/src/core/proto/proto_socks.c
 +++ b/src/core/proto/proto_socks.c
 @@ -615,6 +615,7 @@ process_socks5_client_request(socks_request_t *req,
                                int safe_socks)
  {
    socks_result_t res = SOCKS_RESULT_DONE;
 +  tor_addr_t tmpaddr;

    if (req->command != SOCKS_COMMAND_CONNECT &&
        req->command != SOCKS_COMMAND_RESOLVE &&
 @@ -625,8 +626,7 @@ process_socks5_client_request(socks_request_t *req,
    }

    if (req->command == SOCKS_COMMAND_RESOLVE_PTR &&
 -      !string_is_valid_ipv4_address(req->address) &&
 -      !string_is_valid_ipv6_address(req->address)) {
 +      tor_addr_parse(&tmpaddr, req->address) < 0) {
      socks_request_set_socks5_error(req,
 SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED);
      log_warn(LD_APP, "socks5 received RESOLVE_PTR command with "
                       "hostname type. Rejecting.");
 }}}
 Eventually, in connection_ap_handshake_send_resolve, the string will be
 passed to tor_addr_parse_PTR_name, which accepts IPv6 literals either with
 or without brackets.

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


More information about the tor-bugs mailing list