|
|
Message-ID: <20261125145751.GQ5716@brightrain.aerifal.cx> Date: Wed, 25 Nov 2026 09:57:51 -0500 From: Rich Felker <dalias@...c.org> To: zhaotq@....edu.cn Cc: musl@...ts.openwall.com Subject: Re: getaddrinfo accepts a DNS reply with QDCOUNT=0 On Wed, Nov 25, 2026 at 09:45:53PM +0800, zhaotq@....edu.cn wrote: > Hello, > > While testing musl 1.2.5, we found that getaddrinfo() accepts a DNS reply > that does not contain a question section. The same code is still present in > musl 1.2.6 and current master. Does this lead to any ill effects you're aware of? I don't see any ways it does. I don't recall the entire reasoning process behind writing this, but I think it's intentional that the query section of the response is not compared with the outgoing query, since (at least in theory; I don't recall offhand if this is conforming or not) it can differ in representation (e.g. case) from the outgoing one. In the absence of a good reason to check it, that's just more code/bug-surface. We could demand that QDCOUNT==1, but without actually comparing the name, that wouldn't really harden against spoofing or anything (which is already assumed to be possible; if you need full protection against that you need a trustworthy route to a validating nameserver) since it's just as easy to forge QDCOUNT==1 with the wrong name as QDCOUNT==0. If others have good reasons something should be changed here, I'm not opposed to a change, but I don't see it as a priority. BTW apologies if I'm mistaken on this, but the report as submitted looks like it might have been LLM-generated or -edited. The first sentence of the email was plenty to convey the whole thing. It's fine making a longer write-up if that helps you organize ideas or whatnot, but if it's LLM output please don't send that to the list. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.