]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: payload: prevent integer overflow in distcc token parsing
authorWilly Tarreau <w@1wt.eu>
Wed, 29 Apr 2026 07:19:57 +0000 (09:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 29 Apr 2026 13:11:44 +0000 (15:11 +0200)
commit465dca8e81e9db695880beda1dd973a794074895
treeb6dcd39315d69b98c979111177ff1f1a45603777
parent5cd666b0e3ca43d8d6311b902793666617665b31
BUG/MINOR: payload: prevent integer overflow in distcc token parsing

In both smp_fetch_distcc_param() and smp_fetch_distcc_body(), the code
does "ofs += body" without checking if body is larger than the remaining
data. If a malicious distcc packet contains a token with a very large
body length (param value up to 0xFFFFFFFF), ofs could overflow and wrap
around to a small value, causing the next iteration's bounds check
"ofs + 12 > ci_data(chn)" to pass incorrectly.

This could lead to out-of-bounds reads or an infinite loop.

Given that this is only used in trusted environments, this is mostly
harmless. It can be backported to all stable versions.
src/payload.c