]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: hlua: Forbid any L6/L7 sample fetche functions from lua services
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 24 Jun 2025 06:26:14 +0000 (08:26 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 30 Jun 2025 14:47:59 +0000 (16:47 +0200)
commita2a142bf40c76114cf85dfe1f48d7b14ec70ad5f
treee8daeb121afef9c009155ef372ee69b5123d2b35
parent7fc8ab0397f01c58a31f203b4d97c79cff3ae244
BUG/MEDIUM: hlua: Forbid any L6/L7 sample fetche functions from lua services

It was already forbidden to use HTTP sample fetch functions from lua
services. An error is triggered if it happens. However, the error must be
extended to any L6/L7 sample fetch functions.

Indeed, a lua service is an applet. It totally unexepected for an applet to
access to input data in a channel's buffer. These data have not been
analyzed yet and are still subject to any change. An applet, lua or not,
must never access to "not forwarded" data. Only output data are
available. For now, if a lua applet relies on any L6/L7 sampel fetch
functions, the behavior is undefined and not consistent.

So to fix the issue, hlua flag HLUA_F_MAY_USE_HTTP is renamed to
HLUA_F_MAY_USE_CHANNELS_DATA. This flag is used to prevent any lua applet to
use L6/L7 sample fetch functions.

This patch could be backported to all stable versions.
include/haproxy/hlua-t.h
src/hlua.c