]> git.kaiwu.me - haproxy.git/commit
DOC: config: document the FCGI path handling and its security implications
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 30 Nov 2026 14:15:15 +0000 (15:15 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 30 Nov 2026 15:03:42 +0000 (16:03 +0100)
commit6d19ea0a74ef8e116cdbbcb88cf82be3c138d17f
tree679b2d3599ff1246d2a6e8721843a7b850d81cde
parent7a9c3797ea8bc6c971bc50d322dd2cb1644aa6ce
DOC: config: document the FCGI path handling and its security implications

Some users report the FCGI support as a security issue because the
request path is URL-decoded and used to build the SCRIPT_NAME,
SCRIPT_FILENAME, PATH_INFO and PATH_TRANSLATED parameters without any
check: a path with '.' or '..' segments, or an absolute path, may point
outside the document root, and if the FastCGI application executes the
corresponding script, it may serve arbitrary files.

This is intentional. HAProxy does not normalize request paths by
default and passes them as-is, because only the component that will
interpret the request reliably knows how to normalize its paths
depending on its environment. HAProxy is not aware of the file system
layout, the mount points or the symlinks on the remote host, so it
cannot safely know if a path is finally inside or outside the document
root. It is the application's responsibility to check the script it is
asked to execute, exactly like for a web server, and it may also be
handled by the administrator with http-request rules.

To prevent the same question from being raised again, this is now
clearly documented in a new section 10.4 'Path handling and security
considerations', with a pointer from the docroot directive.

No backport is needed.
doc/configuration.txt