From: Jo-Philipp Wich Date: Wed, 4 Apr 2018 22:33:09 +0000 (+0200) Subject: luci-mod-admin-full: fix possible shell injection in bandwith status X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=9e4b8a91384562e3baee724a52b72e30b1aa006d luci-mod-admin-full: fix possible shell injection in bandwith status Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua index 22e1b7e17..4b03a1886 100644 --- a/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua +++ b/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua @@ -62,7 +62,7 @@ end function action_bandwidth(iface) luci.http.prepare_content("application/json") - local bwc = io.popen("luci-bwc -i %q 2>/dev/null" % iface) + local bwc = io.popen("luci-bwc -i '%s' 2>/dev/null" % iface:gsub("'", "")) if bwc then luci.http.write("[") @@ -80,7 +80,7 @@ end function action_wireless(iface) luci.http.prepare_content("application/json") - local bwc = io.popen("luci-bwc -r %q 2>/dev/null" % iface) + local bwc = io.popen("luci-bwc -r '%s' 2>/dev/null" % iface:gsub("'", "")) if bwc then luci.http.write("[")