]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: resolvers: fix name compression pointer validation in resolv_read_name()
authorWilly Tarreau <w@1wt.eu>
Thu, 14 May 2026 22:10:46 +0000 (22:10 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 May 2026 13:33:14 +0000 (15:33 +0200)
commitbb5c18ab7444471a762b98f823f2215e9b25f975
tree5bc6ed48a447da027fad859b4d501bcc5b86fecb
parentfefce297ab5d0c36d6d6773092c976ea6166dc1e
BUG/MEDIUM: resolvers: fix name compression pointer validation in resolv_read_name()

The original DNS code would only use the 8 lower bits of the compression
offset. This was fixed in 2.0 with commit 2fa66c3b9 ("BUG/MEDIUM: dns:
overflowed dns name start position causing invalid dns error") but it was
not sufficient because the anti-loop check continues to use only 8 of the
14 bits, thus a crafted response where the 8 lower bits pass the check and
the 6 higher should fail it would be accepted. The impacts remains limited
thanks to the bounds check and the recursion limits, but such invalid
responses could still cost a lot to process. Let's compute the 14-bit
offset once for all and use it everywhere.
src/resolvers.c