mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
JS: Add test case showing false negative
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| query-tests/Security/CWE-079/DomBasedXss/jquery.js:37 | expected an alert, but found none | NOT OK | |
|
||||
|
||||
@@ -431,6 +431,8 @@ nodes
|
||||
| jquery.js:34:5:34:25 | '<b>' + ... '</b>' |
|
||||
| jquery.js:34:5:34:25 | '<b>' + ... '</b>' |
|
||||
| jquery.js:34:13:34:16 | hash |
|
||||
| jquery.js:36:25:36:31 | tainted |
|
||||
| jquery.js:36:25:36:31 | tainted |
|
||||
| json-stringify.jsx:5:9:5:36 | locale |
|
||||
| json-stringify.jsx:5:9:5:36 | locale |
|
||||
| json-stringify.jsx:5:18:5:36 | req.param("locale") |
|
||||
@@ -1512,6 +1514,8 @@ edges
|
||||
| express.js:7:15:7:33 | req.param("wobble") | express.js:7:15:7:33 | req.param("wobble") |
|
||||
| jquery.js:2:7:2:40 | tainted | jquery.js:7:20:7:26 | tainted |
|
||||
| jquery.js:2:7:2:40 | tainted | jquery.js:8:28:8:34 | tainted |
|
||||
| jquery.js:2:7:2:40 | tainted | jquery.js:36:25:36:31 | tainted |
|
||||
| jquery.js:2:7:2:40 | tainted | jquery.js:36:25:36:31 | tainted |
|
||||
| jquery.js:2:17:2:40 | documen ... .search | jquery.js:2:7:2:40 | tainted |
|
||||
| jquery.js:2:17:2:40 | documen ... .search | jquery.js:2:7:2:40 | tainted |
|
||||
| jquery.js:7:20:7:26 | tainted | jquery.js:7:5:7:34 | "<div i ... + "\\">" |
|
||||
@@ -2355,6 +2359,7 @@ edges
|
||||
| jquery.js:27:5:27:25 | hash.re ... #', '') | jquery.js:18:14:18:33 | window.location.hash | jquery.js:27:5:27:25 | hash.re ... #', '') | Cross-site scripting vulnerability due to $@. | jquery.js:18:14:18:33 | window.location.hash | user-provided value |
|
||||
| jquery.js:28:5:28:43 | window. ... ?', '') | jquery.js:28:5:28:26 | window. ... .search | jquery.js:28:5:28:43 | window. ... ?', '') | Cross-site scripting vulnerability due to $@. | jquery.js:28:5:28:26 | window. ... .search | user-provided value |
|
||||
| jquery.js:34:5:34:25 | '<b>' + ... '</b>' | jquery.js:18:14:18:33 | window.location.hash | jquery.js:34:5:34:25 | '<b>' + ... '</b>' | Cross-site scripting vulnerability due to $@. | jquery.js:18:14:18:33 | window.location.hash | user-provided value |
|
||||
| jquery.js:36:25:36:31 | tainted | jquery.js:2:17:2:40 | documen ... .search | jquery.js:36:25:36:31 | tainted | Cross-site scripting vulnerability due to $@. | jquery.js:2:17:2:40 | documen ... .search | user-provided value |
|
||||
| json-stringify.jsx:31:40:31:61 | JSON.st ... locale) | json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) | Cross-site scripting vulnerability due to $@. | json-stringify.jsx:5:18:5:36 | req.param("locale") | user-provided value |
|
||||
| json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) | json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) | Cross-site scripting vulnerability due to $@. | json-stringify.jsx:5:18:5:36 | req.param("locale") | user-provided value |
|
||||
| jwt-server.js:11:19:11:29 | decoded.foo | jwt-server.js:7:17:7:35 | req.param("wobble") | jwt-server.js:11:19:11:29 | decoded.foo | Cross-site scripting vulnerability due to $@. | jwt-server.js:7:17:7:35 | req.param("wobble") | user-provided value |
|
||||
|
||||
@@ -431,6 +431,8 @@ nodes
|
||||
| jquery.js:34:5:34:25 | '<b>' + ... '</b>' |
|
||||
| jquery.js:34:5:34:25 | '<b>' + ... '</b>' |
|
||||
| jquery.js:34:13:34:16 | hash |
|
||||
| jquery.js:36:25:36:31 | tainted |
|
||||
| jquery.js:36:25:36:31 | tainted |
|
||||
| json-stringify.jsx:5:9:5:36 | locale |
|
||||
| json-stringify.jsx:5:9:5:36 | locale |
|
||||
| json-stringify.jsx:5:18:5:36 | req.param("locale") |
|
||||
@@ -1562,6 +1564,8 @@ edges
|
||||
| express.js:7:15:7:33 | req.param("wobble") | express.js:7:15:7:33 | req.param("wobble") |
|
||||
| jquery.js:2:7:2:40 | tainted | jquery.js:7:20:7:26 | tainted |
|
||||
| jquery.js:2:7:2:40 | tainted | jquery.js:8:28:8:34 | tainted |
|
||||
| jquery.js:2:7:2:40 | tainted | jquery.js:36:25:36:31 | tainted |
|
||||
| jquery.js:2:7:2:40 | tainted | jquery.js:36:25:36:31 | tainted |
|
||||
| jquery.js:2:17:2:40 | documen ... .search | jquery.js:2:7:2:40 | tainted |
|
||||
| jquery.js:2:17:2:40 | documen ... .search | jquery.js:2:7:2:40 | tainted |
|
||||
| jquery.js:7:20:7:26 | tainted | jquery.js:7:5:7:34 | "<div i ... + "\\">" |
|
||||
|
||||
@@ -32,4 +32,7 @@ function test() {
|
||||
$(hash + 'blah'); // OK
|
||||
$('blah' + hash); // OK - does not start with '<'
|
||||
$('<b>' + hash + '</b>'); // NOT OK
|
||||
|
||||
$('#foo').replaceWith(tainted); // NOT OK
|
||||
$('#foo').replaceWith(() => tainted); // NOT OK
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user