luci-base: don't propagate null bytes in path information
It is possible to inject unescaped markup using a double encoded null byte via PATH_INFO on certain leaf nodes. Since there is no legitimate reason to handle null bytes in any part of the requested url, simply skip over such bytes when parsing the PATH_INFO value. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
ad7dc4a492
commit
b194b8882e
1 changed files with 2 additions and 1 deletions
|
@ -113,7 +113,8 @@ function httpdispatch(request, prefix)
|
|||
end
|
||||
end
|
||||
|
||||
for node in pathinfo:gmatch("[^/]+") do
|
||||
local node
|
||||
for node in pathinfo:gmatch("[^/%z]+") do
|
||||
r[#r+1] = node
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue