]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/CRITICAL: hpack: fix improper sign check on the header index value
authorWilly Tarreau <w@1wt.eu>
Mon, 17 Sep 2018 12:07:33 +0000 (14:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Sep 2018 09:45:56 +0000 (11:45 +0200)
commit7f2a44d319283b5d8e551640bb63c15a2df20358
treedaed551cdbf7b054fb9a5b9ef1bf577ed9521c19
parentf7db9305aa8642cb5145bba6f8948400c52396af
BUG/CRITICAL: hpack: fix improper sign check on the header index value

Tim Düsterhus found using afl-fuzz that some parts of the HPACK decoder
use incorrect bounds checking which do not catch negative values after
a type cast. The first culprit is hpack_valid_idx() which takes a signed
int and is fed with an unsigned one, but a few others are affected as
well due to being designed to work with an uint16_t as in the table
header, thus not being able to detect the high offset bits, though they
are not exposed if hpack_valid_idx() is fixed.

The impact is that the HPACK decoder can be crashed by an out-of-bounds
read. The only work-around without this patch is to disable H2 in the
configuration.

CVE-2018-14645 was assigned to this bug.

This patch addresses all of these issues at once. It must be backported
to 1.8.
include/common/hpack-tbl.h
src/hpack-dec.c
src/hpack-tbl.c