Skip to content

Commit c5545f0

Browse files
committed
JS: Remove same-line Source expectations
1 parent d349b51 commit c5545f0

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ var server = http.createServer(function(req, res) {
5151

5252
var server = http.createServer(function(req, res) {
5353
// tests for a few uri-libraries
54-
res.write(fs.readFileSync(require("querystringify").parse(req.url).query)); // $ Alert Source
55-
res.write(fs.readFileSync(require("query-string").parse(req.url).query)); // $ Alert Source
56-
res.write(fs.readFileSync(require("querystring").parse(req.url).query)); // $ Alert Source
54+
res.write(fs.readFileSync(require("querystringify").parse(req.url).query)); // $ Alert
55+
res.write(fs.readFileSync(require("query-string").parse(req.url).query)); // $ Alert
56+
res.write(fs.readFileSync(require("querystring").parse(req.url).query)); // $ Alert
5757
});
5858

5959
(function(){
@@ -173,10 +173,10 @@ import normalizeUrl from 'normalize-url';
173173
var server = http.createServer(function(req, res) {
174174
// tests for a few more uri-libraries
175175
const qs = require("qs");
176-
res.write(fs.readFileSync(qs.parse(req.url).foo)); // $ Alert Source
177-
res.write(fs.readFileSync(qs.parse(normalizeUrl(req.url)).foo)); // $ Alert Source
176+
res.write(fs.readFileSync(qs.parse(req.url).foo)); // $ Alert
177+
res.write(fs.readFileSync(qs.parse(normalizeUrl(req.url)).foo)); // $ Alert
178178
const parseqs = require("parseqs");
179-
res.write(fs.readFileSync(parseqs.decode(req.url).foo)); // $ Alert Source
179+
res.write(fs.readFileSync(parseqs.decode(req.url).foo)); // $ Alert
180180
});
181181

182182
const cp = require("child_process");

javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/normalizedPaths.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ app.get('/dotdot-regexp', (req, res) => {
404404
});
405405

406406
app.get('/join-spread', (req, res) => {
407-
fs.readFileSync(pathModule.join('foo', ...req.query.x.split('/'))); // $ Alert Source
408-
fs.readFileSync(pathModule.join(...req.query.x.split('/'))); // $ Alert Source
407+
fs.readFileSync(pathModule.join('foo', ...req.query.x.split('/'))); // $ Alert
408+
fs.readFileSync(pathModule.join(...req.query.x.split('/'))); // $ Alert
409409
});
410410

411411
app.get('/dotdot-matchAll-regexp', (req, res) => {

javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/tainted-sendFile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ app.get('/some/path/:x', function(req, res) {
1818
res.sendFile(homeDir + '/data/' + req.params.x); // OK - sendFile disallows ../
1919
res.sendfile('data/' + req.params.x); // OK - sendfile disallows ../
2020

21-
res.sendFile(path.resolve('data', req.params.x)); // $ Alert Source
22-
res.sendfile(path.join('data', req.params.x)); // $ Alert Source
21+
res.sendFile(path.resolve('data', req.params.x)); // $ Alert
22+
res.sendfile(path.join('data', req.params.x)); // $ Alert
2323

2424
res.sendFile(homeDir + path.join('data', req.params.x)); // kinda OK - can only escape from 'data/'
2525
});

0 commit comments

Comments
 (0)