]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http: fix encoding of samples used in http headers
authorThierry FOURNIER <tfournier@exceliance.fr>
Thu, 13 Mar 2014 15:46:18 +0000 (16:46 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 17 Mar 2014 15:39:03 +0000 (16:39 +0100)
commitd048d8b89127019b5a42932321c270ec48b44a6b
tree28b3ff8d3865615d1393f68c68f6fd258f7baea2
parente059ec9393e3cce431e28ec7980aac9b295f0e05
BUG/MINOR: http: fix encoding of samples used in http headers

The binary samples are sometimes copied as is into http headers.
A sample can contain bytes unallowed by the http rfc concerning
header content, for example if it was extracted from binary data.
The resulting http request can thus be invalid.

This issue does not yet happen because haproxy currently (mistakenly)
hex-encodes binary data, so it is not really possible to retrieve
invalid HTTP chars.

The solution consists in hex-encoding all non-printable chars prefixed
by a '%' sign.

No backport is needed since existing code is not affected yet.
include/types/log.h
src/cfgparse.c
src/log.c
src/proto_http.c