Skip to content

Commit 726cd2c

Browse files
committed
refactor test
1 parent 9df0720 commit 726cd2c

File tree

2 files changed

+40
-39
lines changed

2 files changed

+40
-39
lines changed

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,15 @@ nodes
436436
| json-stringify.jsx:5:18:5:36 | req.param("locale") |
437437
| json-stringify.jsx:5:18:5:36 | req.param("locale") |
438438
| json-stringify.jsx:5:18:5:36 | req.param("locale") |
439-
| json-stringify.jsx:14:18:14:60 | `https: ... ocale}` |
440-
| json-stringify.jsx:14:53:14:58 | locale |
441-
| json-stringify.jsx:22:18:22:65 | `https: ... ocale}` |
442-
| json-stringify.jsx:22:58:22:63 | locale |
443-
| json-stringify.jsx:30:40:30:45 | locale |
444-
| json-stringify.jsx:30:40:30:45 | locale |
445-
| json-stringify.jsx:30:40:30:45 | locale |
446-
| json-stringify.jsx:34:40:34:61 | JSON.st ... jsonLD) |
447-
| json-stringify.jsx:34:40:34:61 | JSON.st ... jsonLD) |
439+
| json-stringify.jsx:11:16:11:58 | `https: ... ocale}` |
440+
| json-stringify.jsx:11:51:11:56 | locale |
441+
| json-stringify.jsx:19:16:19:63 | `https: ... ocale}` |
442+
| 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 |
446+
| json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
447+
| json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
448448
| jwt-server.js:7:9:7:35 | taint |
449449
| jwt-server.js:7:9:7:35 | taint |
450450
| jwt-server.js:7:17:7:35 | req.param("wobble") |
@@ -1573,22 +1573,22 @@ edges
15731573
| jquery.js:28:5:28:26 | window. ... .search | jquery.js:28:5:28:43 | window. ... ?', '') |
15741574
| jquery.js:34:13:34:16 | hash | jquery.js:34:5:34:25 | '<b>' + ... '</b>' |
15751575
| jquery.js:34:13:34:16 | hash | jquery.js:34:5:34:25 | '<b>' + ... '</b>' |
1576-
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:14:53:14:58 | locale |
1577-
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:22:58:22:63 | locale |
1578-
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:30:40:30:45 | locale |
1579-
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:30:40:30:45 | locale |
1580-
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:30:40:30:45 | locale |
1581-
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:30:40:30:45 | locale |
1576+
| json-stringify.jsx:5:9:5:36 | locale | json-stringify.jsx:11:51:11:56 | locale |
1577+
| 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 |
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:14:18:14:60 | `https: ... ocale}` | json-stringify.jsx:34:40:34:61 | JSON.st ... jsonLD) |
1587-
| json-stringify.jsx:14:18:14:60 | `https: ... ocale}` | json-stringify.jsx:34:40:34:61 | JSON.st ... jsonLD) |
1588-
| json-stringify.jsx:14:53:14:58 | locale | json-stringify.jsx:14:18:14:60 | `https: ... ocale}` |
1589-
| json-stringify.jsx:22:18:22:65 | `https: ... ocale}` | json-stringify.jsx:34:40:34:61 | JSON.st ... jsonLD) |
1590-
| json-stringify.jsx:22:18:22:65 | `https: ... ocale}` | json-stringify.jsx:34:40:34:61 | JSON.st ... jsonLD) |
1591-
| json-stringify.jsx:22:58:22:63 | locale | json-stringify.jsx:22:18:22:65 | `https: ... ocale}` |
1586+
| json-stringify.jsx:11:16:11:58 | `https: ... ocale}` | json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
1587+
| json-stringify.jsx:11:16:11:58 | `https: ... ocale}` | json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
1588+
| json-stringify.jsx:11:51:11:56 | locale | json-stringify.jsx:11:16:11:58 | `https: ... ocale}` |
1589+
| json-stringify.jsx:19:16:19:63 | `https: ... ocale}` | json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
1590+
| json-stringify.jsx:19:16:19:63 | `https: ... ocale}` | json-stringify.jsx:35:40:35:61 | JSON.st ... jsonLD) |
1591+
| json-stringify.jsx:19:56:19:61 | locale | json-stringify.jsx:19:16:19:63 | `https: ... ocale}` |
15921592
| jwt-server.js:7:9:7:35 | taint | jwt-server.js:9:16:9:20 | taint |
15931593
| jwt-server.js:7:9:7:35 | taint | jwt-server.js:9:16:9:20 | taint |
15941594
| 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: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,28 @@ var app = express();
33

44
app.get("/some/path", function (req, res) {
55
const locale = req.param("locale");
6+
const breadcrumbList = [
7+
{
8+
"@type": "ListItem",
9+
position: 1,
10+
item: {
11+
"@id": `https://example.com/some?locale=${locale}`,
12+
name: "Some",
13+
},
14+
},
15+
{
16+
"@type": "ListItem",
17+
position: 2,
18+
item: {
19+
"@id": `https://example.com/some/path?locale=${locale}`,
20+
name: "Path",
21+
},
22+
},
23+
];
624
const jsonLD = {
725
"@context": "https://schema.org",
826
"@type": "BreadcrumbList",
9-
itemListElement: [
10-
{
11-
"@type": "ListItem",
12-
position: 1,
13-
item: {
14-
"@id": `https://example.com/some?locale=${locale}`,
15-
name: "Some",
16-
},
17-
},
18-
{
19-
"@type": "ListItem",
20-
position: 2,
21-
item: {
22-
"@id": `https://example.com/some/path?locale=${locale}`,
23-
name: "Real Dresses",
24-
},
25-
},
26-
],
27+
itemListElement: breadcrumbList,
2728
};
2829
<script
2930
type="application/ld+json"

0 commit comments

Comments
 (0)