Readit News logoReadit News
ghuntley · 2 years ago
AnonymousPlanet · 2 years ago
> See also https://daniel.haxx.se/blog/2023/10/11/how-i-made-a-heap-ove...

I would like to note how frank and transparent Daniel is here. I really appreciate that, not only in a public venue, but also at work. I am very much for an organisational culture that enables this.

gpvos · 2 years ago
> In hindsight, shipping a heap overflow in code installed in over twenty billion instances is not an experience I would recommend.

A heart-rending line. Hugs for Daniel.

qwertox · 2 years ago
> If the hostname is detected to be longer than 255 bytes, curl switches to local name resolving and instead passes on the resolved address only to the proxy.

This sounds like an issue in itself, even if it is intended. Is that max length of the hostname a limitation of SOCKS5?

Let's assume you're using TOR through a SOCKS5 proxy, then any tool which uses libcurl will perform a local host lookup upon a https call (or redirect) to a long hostname, like one with a dynamically assigned UUID in a subdomain.

toast0 · 2 years ago
DNS names are limited to 255 octets or less by RFC1035 (and if you get into the nitty gritty, only 253 bytes really, maybe 254 if you include the trailing dot that is commonly elided) I don't think that limit is relaxed by newer DNS RFCs.
Bu9818 · 2 years ago
I recommend programs using Tor to be run in an empty network namespace then set http/HTTPS/ALL_PROXY to a Unix domain socket created in torrc (or use socat to get it on the namespaces' 127.0.0.1 if not supported by the library), to avoid accidentally misconfiguring programs if their proxy settings are bad or you run a statically linked binary with torsocks.
dirkf · 2 years ago
Note that they no longer do this fallback to local name resolving:

From the advisory:

  Starting in curl 8.4.0, curl no longer switches to local resolve mode if the name is too long but is instead rightfully returning an error.

midasuni · 2 years ago
They changed the behaviour and will now error. Sounds like a protocol limitation
ale42 · 2 years ago
Yes, it is a protocol limitation. The hostname length field in a SOCKS5 request is a single byte, whence the maximum length. As explained in the write-up, curl now returns an error in that specific condition, which seems a more reasonable thing to do.

Deleted Comment