]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: resolvers: reject too long labels when encoding a name
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 29 Sep 2026 07:08:57 +0000 (09:08 +0200)
committerOlivier Houchard <cognet@ci0.org>
Mon, 19 Oct 2026 13:39:00 +0000 (15:39 +0200)
commit612b87e75f399b928903141d9bf8ecf59d4f4f6b
tree22189a0b3c6f9dc990f9996fa06124f91bad834e
parent82af710e04c723134d163d4dfcb409269f3817cb
BUG/MEDIUM: resolvers: reject too long labels when encoding a name

A 256-byte label passed through do-resolve (e.g. from hdr(host)) wraps
its encoded length to zero. Callers using strdup() then truncate the
name but retain its full length, causing out-of-bounds reads and heap
data disclosure in DNS queries. Embedded NULs cause the same issue.

Reject labels longer than DNS_MAX_LABEL_SIZE and embedded NULs in
resolv_str_to_dn_label(), before callers duplicate the encoded name.

This affects do-resolve since its introduction in 2.0 by commit
333939c2e ("MINOR: action: new '(http-request|tcp-request content)
do-resolve' action"). Must be backported to all stable branches.
src/resolvers.c