Skip to content

Commit 192c1f3

Browse files
committed
make test json.stringify
1 parent 726cd2c commit 192c1f3

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/XssWithAdditionalSources.expected

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,11 @@ nodes
440440
| json-stringify.jsx:11:51:11:56 | locale |
441441
| json-stringify.jsx:19:16:19:63 | `https: ... ocale}` |
442442
| json-stringify.jsx:19:56:19:61 | locale |
443-
| json-stringify.jsx:31:40:31:45 | locale |
444-
| json-stringify.jsx:31:40:31:45 | locale |
445-
| json-stringify.jsx:31:40:31:45 | locale |
443+
| json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
444+
| json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
445+
| json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
446+
| json-stringify.jsx:31:55:31:60 | locale |
447+
| json-stringify.jsx:31:55:31:60 | locale |
446448
| json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
447449
| json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
448450
| jwt-server.js:7:9:7:35 | taint |
@@ -1575,20 +1577,29 @@ edges
15751577
| jquery.js:34:13:34:16 | hash | jquery.js:34:5:34:25 | '<b>' + ... '</b>' |
15761578
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:11:51:11:56 | locale |
15771579
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:19:56:19:61 | locale |
1578-
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:31:40:31:45 | locale |
1579-
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:31:40:31:45 | locale |
1580-
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:31:40:31:45 | locale |
1581-
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:31:40:31:45 | locale |
1580+
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:31:55:31:60 | locale |
1581+
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:31:55:31:60 | locale |
15821582
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:5:9:5:36 | locale |
15831583
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:5:9:5:36 | locale |
15841584
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:5:9:5:36 | locale |
15851585
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:5:9:5:36 | locale |
1586+
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
1587+
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
1588+
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
1589+
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
1590+
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
1591+
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
1592+
| json-stringify.jsx:5:18:5:36 | req.param("locale") | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
15861593
| json-stringify.jsx:11:16:11:58 | `https: ... ocale}` | json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
15871594
| json-stringify.jsx:11:16:11:58 | `https: ... ocale}` | json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
15881595
| json-stringify.jsx:11:51:11:56 | locale | json-stringify.jsx:11:16:11:58 | `https: ... ocale}` |
15891596
| json-stringify.jsx:19:16:19:63 | `https: ... ocale}` | json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
15901597
| json-stringify.jsx:19:16:19:63 | `https: ... ocale}` | json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
15911598
| json-stringify.jsx:19:56:19:61 | locale | json-stringify.jsx:19:16:19:63 | `https: ... ocale}` |
1599+
| json-stringify.jsx:31:55:31:60 | locale | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
1600+
| json-stringify.jsx:31:55:31:60 | locale | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
1601+
| json-stringify.jsx:31:55:31:60 | locale | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
1602+
| json-stringify.jsx:31:55:31:60 | locale | json-stringify.jsx:31:40:31:61 | JSON.st ... locale) |
15921603
| jwt-server.js:7:9:7:35 | taint | jwt-server.js:9:16:9:20 | taint |
15931604
| jwt-server.js:7:9:7:35 | taint | jwt-server.js:9:16:9:20 | taint |
15941605
| jwt-server.js:7:17:7:35 | req.param("wobble") | jwt-server.js:7:9:7:35 | taint |

javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/json-stringify.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ app.get("/some/path", function (req, res) {
2828
};
2929
<script
3030
type="application/ld+json"
31-
dangerouslySetInnerHTML={{ __html: locale }} // NOT OK
31+
dangerouslySetInnerHTML={{ __html: JSON.stringify(locale) }} // NOT OK
3232
/>;
3333
<script
3434
type="application/ld+json"

0 commit comments

Comments
 (0)