]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: http/htx: prevent unbounded loop in http_manage_server_side_cookies
authorAndrew McDermott <aim@frobware.com>
Fri, 11 Feb 2022 18:26:49 +0000 (18:26 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Feb 2022 13:42:13 +0000 (14:42 +0100)
commitbfb15ab34ead85f64cd6da0e9fb418c9cd14cee8
tree66511340ebadda472af23291bce598630d47ee6b
parent1d5fdc526b5ebf402e6359a3616a4fc3cc2269b3
BUG/MAJOR: http/htx: prevent unbounded loop in http_manage_server_side_cookies

Ensure calls to http_find_header() terminate. If a "Set-Cookie2"
header is found then the while(1) loop in
http_manage_server_side_cookies() will never terminate, resulting in
the watchdog firing and the process terminating via SIGABRT.

The while(1) loop becomes unbounded because an unmatched call to
http_find_header("Set-Cookie") will leave ctx->blk=NULL. Subsequent
calls to check for "Set-Cookie2" will now enumerate from the beginning
of all the blocks and will once again match on subsequent
passes (assuming a match first time around), hence the loop becoming
unbounded.

This issue was introduced with HTX and this fix should be backported
to all versions supporting HTX.

Many thanks to Grant Spence (gspence@redhat.com) for working through
this issue with me.
src/http_ana.c