mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge branch 'master' of git.semmle.com:Semmle/ql into CVE74
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -115,11 +115,34 @@ var server = http.createServer(function(req, res) {
|
||||
|
||||
});
|
||||
|
||||
var server = http.createServer(function(req, res) {
|
||||
let path = url.parse(req.url, true).query.path;
|
||||
|
||||
if (path) { // sanitization
|
||||
path = path.replace(/[\]\[*,;'"`<>\\?\/]/g, ''); // remove all invalid characters from states plus slashes
|
||||
path = path.replace(/\.\./g, ''); // remove all ".."
|
||||
}
|
||||
|
||||
res.write(fs.readFileSync(path)); // OK. Is sanitized above.
|
||||
});
|
||||
|
||||
var server = http.createServer(function(req, res) {
|
||||
let path = url.parse(req.url, true).query.path;
|
||||
|
||||
if (!path) {
|
||||
|
||||
} else { // sanitization
|
||||
path = path.replace(/[\]\[*,;'"`<>\\?\/]/g, ''); // remove all invalid characters from states plus slashes
|
||||
path = path.replace(/\.\./g, ''); // remove all ".."
|
||||
}
|
||||
|
||||
res.write(fs.readFileSync(path)); // OK. Is sanitized above.
|
||||
});
|
||||
|
||||
var server = http.createServer(function(req, res) {
|
||||
let path = url.parse(req.url, true).query.path;
|
||||
|
||||
require('send')(req, path); // NOT OK
|
||||
|
||||
});
|
||||
|
||||
var server = http.createServer(function(req, res) {
|
||||
|
||||
Reference in New Issue
Block a user