mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
JS: add newline removal tests for js/incomplete-sanitization
This commit is contained in:
@@ -25,4 +25,7 @@
|
||||
| tst.js:140:2:140:27 | s.repla ... replace | This replaces only the first occurrence of /}/. |
|
||||
| tst.js:141:2:141:10 | s.replace | This replaces only the first occurrence of ']'. |
|
||||
| tst.js:141:2:141:27 | s.repla ... replace | This replaces only the first occurrence of '['. |
|
||||
| tst.js:185:9:185:17 | s.replace | This replaces only the first occurrence of /'/. |
|
||||
| tst.js:146:2:146:68 | require ... replace | This replaces only the first occurrence of "\\n". |
|
||||
| tst.js:148:2:148:10 | x.replace | This replaces only the first occurrence of "\\n". |
|
||||
| tst.js:149:2:149:24 | x.repla ... replace | This replaces only the first occurrence of "\\n". |
|
||||
| tst.js:193:9:193:17 | s.replace | This replaces only the first occurrence of /'/. |
|
||||
|
||||
@@ -141,6 +141,14 @@ function good12(s) {
|
||||
s.replace(']', '').replace('[', ''); // probably OK, but still flagged
|
||||
}
|
||||
|
||||
function newlines(s) {
|
||||
// motivation for whitelist
|
||||
require("child_process").execSync("which emacs").toString().replace("\n", ""); // OK
|
||||
|
||||
x.replace("\n", "").replace(x, y); // NOT OK
|
||||
x.replace(x, y).replace("\n", ""); // NOT OK
|
||||
}
|
||||
|
||||
app.get('/some/path', function(req, res) {
|
||||
let untrusted = req.param("p");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user