Live data from Hacker News

Critical Cache Poisoning Vulnerability in Dnsmasq

lists.thekelleys.org.uk

21–30 of 118 posts

Re: Critical Cache Poisoning Vulnerability in Dnsmasq

#21
post #18
post #5

I'm confused. There are no "special characters" in domain names -- they're length-tagged 8-bit clean. Hostnames (as opposed to domain names) are limited by convention to a subset of ASCII, but that shouldn't impact resolver logic. What resolvers silently discard (or do anything else weird with) requests with QNAMES that have non-hostname queries (which aren't "malformed")? The "special character" thing sounds like a…

Yes. RFC 2181 § 11 explicitly contradicts this report. That said, I should point out that there is nowadays a loophole for special-casing labels that begin with underscore, called out by the SVCB document. The loophole does not allow for dropping the client requests, though. On the gripping hand, all that this report boils down to is a rediscovery that if the queried server does not answer immediately, there's a wind…

A nit: we've known about the flaw since 1993 (see https://www.cerias.purdue.edu/assets/pdf/bibtex_archive/94-0...)

Re: Critical Cache Poisoning Vulnerability in Dnsmasq

#22
post #18
post #5

I'm confused. There are no "special characters" in domain names -- they're length-tagged 8-bit clean. Hostnames (as opposed to domain names) are limited by convention to a subset of ASCII, but that shouldn't impact resolver logic. What resolvers silently discard (or do anything else weird with) requests with QNAMES that have non-hostname queries (which aren't "malformed")? The "special character" thing sounds like a…

Yes. RFC 2181 § 11 explicitly contradicts this report. That said, I should point out that there is nowadays a loophole for special-casing labels that begin with underscore, called out by the SVCB document. The loophole does not allow for dropping the client requests, though. On the gripping hand, all that this report boils down to is a rediscovery that if the queried server does not answer immediately, there's a wind…

Novel or not, this seems like it can be actively exploited?

Re: Critical Cache Poisoning Vulnerability in Dnsmasq

#23
post #6

Would an effective mitigation be to drop inbound DNS queries that match those special characters using DPI?

No. The special characters thing is a red herring. All resolvers must handle a lack of response via timeout (particularly since DNS mostly uses UDP).

The correct mitigation is turning on DNSSEC. This sort of attack, known since 1993, is why DNSSEC was created.

Re: Critical Cache Poisoning Vulnerability in Dnsmasq

#24
post #18

Earlier quoted context omitted.

Yes. RFC 2181 § 11 explicitly contradicts this report. That said, I should point out that there is nowadays a loophole for special-casing labels that begin with underscore, called out by the SVCB document. The loophole does not allow for dropping the client requests, though. On the gripping hand, all that this report boils down to is a rediscovery that if the queried server does not answer immediately, there's a wind…

Novel or not, this seems like it can be actively exploited?

Sure. As it is a fundamental flaw in the DNS protocol itself, it is not unique to dnsmasq (it applies to any resolver).

Re: Critical Cache Poisoning Vulnerability in Dnsmasq

#25
post #17
post #14

A bit surprising that the transaction ID is only 16 bits. Presumably the source port doesn't even need to be guessed if someone is on the path between dnsmasq and the upstream DNS server.

This is why DNSSEC was created.

encrypted DNS goes a long way towards mitigating this as well.

Re: Critical Cache Poisoning Vulnerability in Dnsmasq

#26
post #17
post #14

A bit surprising that the transaction ID is only 16 bits. Presumably the source port doesn't even need to be guessed if someone is on the path between dnsmasq and the upstream DNS server.

This is why DNSSEC was created.

DNSSEC was created because we needed to put root and gTLD servers in Russia and China (lying authoritatives). Transport security like dnscrypt and DoH were created to solve this problem. DNS cookies are also strong mitigations.

Re: Critical Cache Poisoning Vulnerability in Dnsmasq

#27
post #26
post #17

Earlier quoted context omitted.

This is why DNSSEC was created.

DNSSEC was created because we needed to put root and gTLD servers in Russia and China (lying authoritatives). Transport security like dnscrypt and DoH were created to solve this problem. DNS cookies are also strong mitigations.

[deleted]

Re: Critical Cache Poisoning Vulnerability in Dnsmasq

#28

I thought they have accidentally "responsibly disclosed" the vulnerability directly into a public mailing list, but the attached pdf is dated >3 months ago. So assume it's a bit of an inaccurate phrasing. EDIT: nope, the email itself seeks disclosure coordination etc. So yeah, oops.

dnsmasq has no security contact

Re: Critical Cache Poisoning Vulnerability in Dnsmasq

#29
post #23
post #6

Would an effective mitigation be to drop inbound DNS queries that match those special characters using DPI?

No. The special characters thing is a red herring. All resolvers must handle a lack of response via timeout (particularly since DNS mostly uses UDP). The correct mitigation is turning on DNSSEC. This sort of attack, known since 1993, is why DNSSEC was created.

[deleted]

Re: Critical Cache Poisoning Vulnerability in Dnsmasq

#30
post #15

Earlier quoted context omitted.

Dnsmasq forwards invalid requests (containing invalid characters) to the resolver. The resolver silently ignores these requests. However, Dnsmasq continues to wait for a response. The attacker only needs to brute force 32 bits (source port and TxID) to falsify a response and poison the cache. The correct and expected behaviour of Dnsmasq would have been not to forward invalid requests to the resolver.

No. They aren't "invalid requests". You can put literally anything in a domain name (see RFC 2181, section 11) and the upstream should respond. I'm curious what resolvers are dropping these requests. The correct behavior is for dnsmasq to forward requests to the upstream regardless of the content of the QNAME. If dnsmasq doesn't get a response back in some reasonable amount of time, it should (probably) return SERVFA…

Query ID prediction attacks are not in fact the point of DNSSEC, which will not actually meaningfully address this attack because almost nothing in the DNS is signed.
Post reply on HN