mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-05-09 22:26:18 +02:00
dont allow directory traversal
This commit is contained in:
parent
7b86eb09bc
commit
9d4e5f6e35
@ -145,7 +145,6 @@ function minify(req, res, next)
|
||||
filename = path.normalize(path.join(ROOT_DIR, filename));
|
||||
if (filename.indexOf(ROOT_DIR) == 0) {
|
||||
filename = filename.slice(ROOT_DIR.length);
|
||||
filename = filename.replace(/\\/g, '/'); // Windows (safe generally?)
|
||||
} else {
|
||||
res.writeHead(404, {});
|
||||
res.end();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user