]> git.kaiwu.me - haproxy.git/commit
BUG/MAJOR: http-htx: Store new host in a chunk for scheme-based normalization
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 24 Apr 2026 08:21:45 +0000 (10:21 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 29 Apr 2026 08:03:26 +0000 (10:03 +0200)
commit48afa73af81876f064d02d01ec6ad1a9da34adcb
treed585dc8ba49511772380ad40c985295c3064884f
parent213ee17119774aeaf6ee153117fb522e9d8d7d99
BUG/MAJOR: http-htx: Store new host in a chunk for scheme-based normalization

During the scheme based normalization, The original authority value is used
to replace every host headers. It is an issue, because when the HTX message
is modified the blocks may be reorganised to find free space. For instance a
defragmentation can be performed. So the address of the authority can
change. To perform such rewrite, the new value must be stored in a temporary
buffer. It is especially important because the start-line is also updated,
so the original authority could be moved, making it invalid.

Because of this bug, it is possible to mix HTX block values. There is no
overflow but the start-line can be crushed with data from the host header
value, making it invalid for the server.

So, to fix the issue, the new host header value is now the one in the trash
chunk used to rewrite the start line. But in that case, the trash chunk must
be allocated to be sure it remains valid when replacing all host headers
values.

This patch must be backported as far as 2.6.
src/http_htx.c