]> git.kaiwu.me - haproxy.git/commit
BUG/MAJOR: resolvers: Properly lowered the names found in DNS response
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Mar 2026 17:29:21 +0000 (18:29 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 5 Mar 2026 14:35:31 +0000 (15:35 +0100)
commit25d6e65aaef5cb8ae369d7a1300a2386dd2b59f9
treeb6f140d16ff7eb33d2ed6d0dccc1258f01bbe503
parent96286b2a8440e98c43c5a027a3f820ca327cb1e5
BUG/MAJOR: resolvers: Properly lowered the names found in DNS response

Names found in DNS responses are lowered to be compared. A name is composed
of several labels, strings precedeed by their length on one byte. For
instance:

 3www7haproxy3org

There is an bug when labels are lowered. The label length is not skipped and
tolower() function is called on it. So for label length in the range [65-90]
(uppercase char), 32 is added to the label length due to the conversion of a
uppercase char to lowercase. This bugs can lead to OOB read later in the
resolvers code.

The fix is quite obvious, the label length must be skipped when the label is
lowered.

Thank you to Kamil Frankowicz for having reported this.

This patch must be backported to all stable versions.
src/resolvers.c