]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: mux-fcgi: fix uint16_t overflow in drl += drp
authorTristan Madani <tristan@talencesecurity.com>
Tue, 16 Jun 2026 08:46:03 +0000 (10:46 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 16 Jun 2026 16:03:01 +0000 (18:03 +0200)
commit5985276735777634d8c85f1d73bb7764aab0d6dd
tree97227a56d811d91215d6d7f963cf98a493b23f3b
parent43932db8513611407c024c7268f6018bbe8bdaf2
BUG/MEDIUM: mux-fcgi: fix uint16_t overflow in drl += drp

The FCGI demux record length field (drl) is uint16_t. In the
ignore_record path, the expression "fconn->drl += fconn->drp" overflows
to 0 when contentLength=65535 and paddingLength>=1. This causes the
state machine to consider the record complete without consuming any
buffer data. The remaining buffer contents are then parsed as new FCGI
record headers.

The same drl+=drp pattern at lines 2382/2418/2475 is not affected
because drl is guaranteed to be 0 at those points (all content bytes
are consumed before reaching end_transfer).

Widen drl from uint16_t to uint32_t so that the addition of drp
(uint8_t, max 255) cannot overflow.

Reported-by: Tristan (@TristanInSec)
src/mux_fcgi.c