luci-base: sys: prevent path traversal via sys.init routines
authorJo-Philipp Wich <[email protected]>
Wed, 19 Jan 2022 15:32:52 +0000 (16:32 +0100)
committerJo-Philipp Wich <[email protected]>
Wed, 19 Jan 2022 15:32:52 +0000 (16:32 +0100)
commit8752701b0d01a81d0bd0a735be733f24ad11ab69
tree48741b61bb0a70dc78bdc815df7a67f1f14aeea1
parent35df2adaf8a2c5b4fa61f58049f409ca087c0547
luci-base: sys: prevent path traversal via sys.init routines

Filter the init script name parameter through fs.basename() to avoid
invoking paths outside of /etc/init.d/.

Reported-by: Graham R <[email protected]>
Signed-off-by: Jo-Philipp Wich <[email protected]>
modules/luci-base/luasrc/sys.lua