]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: resolvers: relax size checks in authority record parsing
authorWilly Tarreau <w@1wt.eu>
Fri, 22 May 2026 06:47:39 +0000 (06:47 +0000)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 May 2026 11:13:24 +0000 (13:13 +0200)
commit4f58fef3d4cbe31db92ff500e2c186c745ea0ee4
tree3f2a66751f16d6dc1f9dedc7296bc79277316c0e
parent73472025f2ffd55595e0c1f3dfc600cecb57fbbd
BUG/MINOR: resolvers: relax size checks in authority record parsing

Both boundary checks in the authority record parsing loop of
resolv_validate_dns_response() use >= bufend where they should use
> bufend, causing valid DNS responses with exactly enough bytes to be
rejected as invalid.

The first one, "reader + offset + 10 >= bufend" is too strict since it
prevents 10-byte responses from being accepted as valid while they
are. The second one, "reader + len >= bufend" has the same issue, when
exactly len bytes remain, the check rejects it even though dns_max_name()
already validated it. It may be backported though it is unlikely to ever
be noticed.
src/resolvers.c