]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: backend: correct parameter value validation in get_server_ph_post()
authorWilly Tarreau <w@1wt.eu>
Fri, 15 May 2026 05:14:45 +0000 (05:14 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 May 2026 13:03:16 +0000 (15:03 +0200)
commitda4a4976d79f47e57526c656c4f8a3100e2d34a8
tree5d5d34b00ca7ec2a7381bc82e489ba0e71a310f0
parent4a499938d0b21a316de103797f27e53b5c3abe29
BUG/MINOR: backend: correct parameter value validation in get_server_ph_post()

In the inner while loop that validates each character of a POST parameter
value, the code checks *p via HTTP_IS_TOKEN() and HTTP_IS_LWS() instead
of *end, while the loop condition only advances "end", so only the first
character of each value is validated.

This means spaces or binary data embedded in parameter values after the
first character goes undetected. Fix by replacing both references to *p
with *end to properly scan through all characters as intended.

This bug was introduced in 1.5-dev20 by commit 98634f0c7 ("MEDIUM:
backend: Enhance hash-type directive with an algorithm options") so
the fix must be backported to all versions.
src/backend.c