]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: h2/htx: verify that :path doesn't contain invalid chars
authorWilly Tarreau <w@1wt.eu>
Tue, 5 Mar 2019 09:47:37 +0000 (10:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 Mar 2019 09:58:28 +0000 (10:58 +0100)
commit9255e7e9713a03486f8fc4ac8deba47a9e621dfe
tree0e1114f0fc6f652ed65c382b63877bce79c21dd8
parent7196dd6071bc38e6dada98bb00426dd54ca13ba3
BUG/MEDIUM: h2/htx: verify that :path doesn't contain invalid chars

While the legacy code converts h2 to h1 and provides some control over
what is passed, in htx mode there is no such control and it is possible
to pass control chars and linear white spaces in the path, which are
possibly reencoded differently once passed to the H1 side.

HTX supports parse error reporting using a special flag. Let's check
the correctness of the :path pseudo header and report any anomaly in
the HTX flag.

Thanks to Jérôme Magnin for reporting this bug with a working reproducer.

This fix must be backported to 1.9 along with the two previous patches
("MINOR: htx: unconditionally handle parsing errors in requests or
responses" and "MINOR: mux-h2: always pass HTX_FL_PARSING_ERROR
between h2s and buf on RX").
src/h2.c