mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-08 02:24:59 -04:00
HAProxy has always called luaL_openlibs() unconditionally, which opens all 10 standard Lua libraries including io, os, package and debug. This makes it impossible to prevent Lua scripts from executing binaries (os.execute, io.popen), loading native C modules (package/require), or bypassing any Lua-level sandbox via the debug library. Add a new global directive tune.lua.openlibs that accepts a comma-separated list of library names to load: tune.lua.openlibs none # only base + coroutine tune.lua.openlibs string,math,table,utf8 # safe libs only tune.lua.openlibs all # default, same as before The base and coroutine libraries are always loaded regardless: base provides core Lua functions that HAProxy relies on, and coroutine is required because HAProxy overrides coroutine.create() with its own safe implementation. When all libraries are enabled (the default), the fast path still calls luaL_openlibs() directly with no overhead. A parse error is returned if the directive appears after lua-load or lua-load-per-thread (the Lua state is already initialised at that point), or if 'none' is combined with other library names. Note that fork() and new thread creation are already blocked by default regardless of this setting (see "insecure-fork-wanted"). |
||
|---|---|---|
| .. | ||
| design-thoughts | ||
| internals | ||
| lua-api | ||
| 51Degrees-device-detection.txt | ||
| acl.fig | ||
| coding-style.txt | ||
| configuration.txt | ||
| cookie-options.txt | ||
| DeviceAtlas-device-detection.txt | ||
| gpl.txt | ||
| haproxy.1 | ||
| HAProxyCommunityEdition_60px.png | ||
| haterm.txt | ||
| intro.txt | ||
| lgpl.txt | ||
| linux-syn-cookies.txt | ||
| lua.txt | ||
| management.txt | ||
| netscaler-client-ip-insertion-protocol.txt | ||
| network-namespaces.txt | ||
| peers-v2.0.txt | ||
| peers.txt | ||
| proxy-protocol.txt | ||
| queuing.fig | ||
| regression-testing.txt | ||
| seamless_reload.txt | ||
| SOCKS4.protocol.txt | ||
| SPOE.txt | ||
| WURFL-device-detection.txt | ||