summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2020-12-30 21:16:13 +0100
committerJose <jose@zeroc.com>2020-12-30 21:16:13 +0100
commit7df6f4533dc905ada0b9a9e53ad004bd80b0cac7 (patch)
treefcf2aef7f08c3b94728761a8d1261d7a0f5f4328 /js
parentUse short cast to make narrow conversion in compound assignment explicit (diff)
downloadice-7df6f4533dc905ada0b9a9e53ad004bd80b0cac7.tar.bz2
ice-7df6f4533dc905ada0b9a9e53ad004bd80b0cac7.tar.xz
ice-7df6f4533dc905ada0b9a9e53ad004bd80b0cac7.zip
Always check path accessed by JavaScript test server
Diffstat (limited to 'js')
-rw-r--r--js/bin/HttpServer.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/js/bin/HttpServer.js b/js/bin/HttpServer.js
index 2e4228bcc52..53825a21aa5 100644
--- a/js/bin/HttpServer.js
+++ b/js/bin/HttpServer.js
@@ -252,6 +252,12 @@ function Init()
filePath);
}
}
+ else if(filePath.indexOf("..") != -1 || ["/test/", "/assets/"].some(prefix => filePath.startsWith(prefix)))
+ {
+ res.writeHead(403);
+ res.end("403 Forbiden");
+ console.log("HTTP/403 (Forbiden) " + req.method + " " + req.url.pathname + " -> " + filePath);
+ }
else
{
if(!stats.isFile())