Skip to content

Commit 379952f

Browse files
authored
Merge pull request github#17285 from asgerf/js/shared-dataflow-bump
JS: Resolve conflicts after merging 'main' into shared data flow branch
2 parents c54f585 + a2dd47a commit 379952f

File tree

7 files changed

+305
-222
lines changed

7 files changed

+305
-222
lines changed

javascript/ql/lib/semmle/javascript/NodeJS.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,10 @@ private predicate isRequire(EarlyStageNode nd) {
309309
// `$.require('underscore');`.
310310
// NPM as supported in [XSJS files](https://www.npmjs.com/package/@sap/async-xsjs#npm-packages-support).
311311
exists(MethodCallExpr require |
312-
nd.getFile().getExtension() = ["xsjs", "xsjslib"] and
312+
require.getFile().getExtension() = ["xsjs", "xsjslib"] and
313313
require.getCalleeName() = "require" and
314314
require.getReceiver().(GlobalVarAccess).getName() = "$" and
315-
nd = require.getCallee().flow()
315+
nd = TValueNode(require.getCallee())
316316
)
317317
}
318318

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

Lines changed: 201 additions & 209 deletions
Large diffs are not rendered by default.

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ nodes
2727
| angular2-client.ts:38:44:38:58 | this.router.url | semmle.label | this.router.url |
2828
| angular2-client.ts:40:45:40:59 | this.router.url | semmle.label | this.router.url |
2929
| angular2-client.ts:44:44:44:76 | routeSn ... ('foo') | semmle.label | routeSn ... ('foo') |
30+
| angular-tempate-url.js:9:26:9:45 | Cookie.get("unsafe") | semmle.label | Cookie.get("unsafe") |
31+
| angular-tempate-url.js:13:30:13:31 | ev | semmle.label | ev |
32+
| angular-tempate-url.js:14:26:14:27 | ev | semmle.label | ev |
33+
| angular-tempate-url.js:14:26:14:32 | ev.data | semmle.label | ev.data |
3034
| classnames.js:7:31:7:84 | `<span ... <span>` | semmle.label | `<span ... <span>` |
3135
| classnames.js:7:47:7:69 | classNa ... w.name) | semmle.label | classNa ... w.name) |
3236
| classnames.js:7:58:7:68 | window.name | semmle.label | window.name |
@@ -636,6 +640,9 @@ edges
636640
| angular2-client.ts:25:44:25:74 | this.ro ... yParams | angular2-client.ts:25:44:25:78 | this.ro ... ams.foo | provenance | |
637641
| angular2-client.ts:34:44:34:80 | this.ro ... ameters | angular2-client.ts:34:44:34:82 | this.ro ... eters.x | provenance | |
638642
| angular2-client.ts:36:44:36:89 | this.ro ... .params | angular2-client.ts:36:44:36:91 | this.ro ... arams.x | provenance | |
643+
| angular-tempate-url.js:13:30:13:31 | ev | angular-tempate-url.js:14:26:14:27 | ev | provenance | |
644+
| angular-tempate-url.js:14:26:14:27 | ev | angular-tempate-url.js:14:26:14:32 | ev.data | provenance | |
645+
| angular-tempate-url.js:14:26:14:32 | ev.data | angular-tempate-url.js:9:26:9:45 | Cookie.get("unsafe") | provenance | |
639646
| classnames.js:7:47:7:69 | classNa ... w.name) | classnames.js:7:31:7:84 | `<span ... <span>` | provenance | |
640647
| classnames.js:7:58:7:68 | window.name | classnames.js:7:47:7:69 | classNa ... w.name) | provenance | |
641648
| classnames.js:8:47:8:70 | classNa ... w.name) | classnames.js:8:31:8:85 | `<span ... <span>` | provenance | |
@@ -1243,6 +1250,7 @@ subpaths
12431250
| angular2-client.ts:38:44:38:58 | this.router.url | angular2-client.ts:38:44:38:58 | this.router.url | angular2-client.ts:38:44:38:58 | this.router.url | Cross-site scripting vulnerability due to $@. | angular2-client.ts:38:44:38:58 | this.router.url | user-provided value |
12441251
| angular2-client.ts:40:45:40:59 | this.router.url | angular2-client.ts:40:45:40:59 | this.router.url | angular2-client.ts:40:45:40:59 | this.router.url | Cross-site scripting vulnerability due to $@. | angular2-client.ts:40:45:40:59 | this.router.url | user-provided value |
12451252
| angular2-client.ts:44:44:44:76 | routeSn ... ('foo') | angular2-client.ts:44:44:44:76 | routeSn ... ('foo') | angular2-client.ts:44:44:44:76 | routeSn ... ('foo') | Cross-site scripting vulnerability due to $@. | angular2-client.ts:44:44:44:76 | routeSn ... ('foo') | user-provided value |
1253+
| angular-tempate-url.js:9:26:9:45 | Cookie.get("unsafe") | angular-tempate-url.js:13:30:13:31 | ev | angular-tempate-url.js:9:26:9:45 | Cookie.get("unsafe") | Cross-site scripting vulnerability due to $@. | angular-tempate-url.js:13:30:13:31 | ev | user-provided value |
12461254
| classnames.js:7:31:7:84 | `<span ... <span>` | classnames.js:7:58:7:68 | window.name | classnames.js:7:31:7:84 | `<span ... <span>` | Cross-site scripting vulnerability due to $@. | classnames.js:7:58:7:68 | window.name | user-provided value |
12471255
| classnames.js:8:31:8:85 | `<span ... <span>` | classnames.js:8:59:8:69 | window.name | classnames.js:8:31:8:85 | `<span ... <span>` | Cross-site scripting vulnerability due to $@. | classnames.js:8:59:8:69 | window.name | user-provided value |
12481256
| classnames.js:9:31:9:85 | `<span ... <span>` | classnames.js:9:59:9:69 | window.name | classnames.js:9:31:9:85 | `<span ... <span>` | Cross-site scripting vulnerability due to $@. | classnames.js:9:59:9:69 | window.name | user-provided value |

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ nodes
2727
| angular2-client.ts:38:44:38:58 | this.router.url | semmle.label | this.router.url |
2828
| angular2-client.ts:40:45:40:59 | this.router.url | semmle.label | this.router.url |
2929
| angular2-client.ts:44:44:44:76 | routeSn ... ('foo') | semmle.label | routeSn ... ('foo') |
30+
| angular-tempate-url.js:9:26:9:45 | Cookie.get("unsafe") | semmle.label | Cookie.get("unsafe") |
31+
| angular-tempate-url.js:13:30:13:31 | ev | semmle.label | ev |
32+
| angular-tempate-url.js:14:26:14:27 | ev | semmle.label | ev |
33+
| angular-tempate-url.js:14:26:14:32 | ev.data | semmle.label | ev.data |
3034
| classnames.js:7:31:7:84 | `<span ... <span>` | semmle.label | `<span ... <span>` |
3135
| classnames.js:7:47:7:69 | classNa ... w.name) | semmle.label | classNa ... w.name) |
3236
| classnames.js:7:58:7:68 | window.name | semmle.label | window.name |
@@ -657,6 +661,9 @@ edges
657661
| angular2-client.ts:25:44:25:74 | this.ro ... yParams | angular2-client.ts:25:44:25:78 | this.ro ... ams.foo | provenance | |
658662
| angular2-client.ts:34:44:34:80 | this.ro ... ameters | angular2-client.ts:34:44:34:82 | this.ro ... eters.x | provenance | |
659663
| angular2-client.ts:36:44:36:89 | this.ro ... .params | angular2-client.ts:36:44:36:91 | this.ro ... arams.x | provenance | |
664+
| angular-tempate-url.js:13:30:13:31 | ev | angular-tempate-url.js:14:26:14:27 | ev | provenance | |
665+
| angular-tempate-url.js:14:26:14:27 | ev | angular-tempate-url.js:14:26:14:32 | ev.data | provenance | |
666+
| angular-tempate-url.js:14:26:14:32 | ev.data | angular-tempate-url.js:9:26:9:45 | Cookie.get("unsafe") | provenance | |
660667
| classnames.js:7:47:7:69 | classNa ... w.name) | classnames.js:7:31:7:84 | `<span ... <span>` | provenance | |
661668
| classnames.js:7:58:7:68 | window.name | classnames.js:7:47:7:69 | classNa ... w.name) | provenance | |
662669
| classnames.js:8:47:8:70 | classNa ... w.name) | classnames.js:8:31:8:85 | `<span ... <span>` | provenance | |

javascript/ql/test/query-tests/Security/CWE-312/BuildArtifactLeak.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ nodes
8282
| build-leaks.js:41:82:41:83 | pw | semmle.label | pw |
8383
subpaths
8484
| build-leaks.js:17:12:19:9 | {\\n ... } | build-leaks.js:14:18:14:20 | env | build-leaks.js:16:20:16:22 | env | build-leaks.js:13:17:19:10 | Object. ... }) |
85+
| build-leaks.js:22:36:22:38 | raw | build-leaks.js:22:49:22:51 | env | build-leaks.js:24:20:24:22 | env | build-leaks.js:22:24:25:14 | Object. ... }, {}) |
8586
| build-leaks.js:22:36:22:38 | raw | build-leaks.js:23:39:23:41 | raw | build-leaks.js:22:49:22:51 | env [Return] | build-leaks.js:25:12:25:13 | [post update] {} |
8687
| build-leaks.js:22:36:22:38 | raw | build-leaks.js:23:39:23:41 | raw | build-leaks.js:24:20:24:22 | env | build-leaks.js:22:24:25:14 | Object. ... }, {}) |
8788
| build-leaks.js:25:12:25:13 | {} | build-leaks.js:22:49:22:51 | env | build-leaks.js:24:20:24:22 | env | build-leaks.js:22:24:25:14 | Object. ... }, {}) |

javascript/ql/test/query-tests/Security/CWE-730/RegExpInjection.expected

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ edges
3939
| RegExpInjection.js:87:25:87:48 | input.r ... g, "\|") | RegExpInjection.js:87:14:87:55 | "^.*\\.( ... + ")$" | provenance | |
4040
| RegExpInjection.js:91:20:91:30 | process.env | RegExpInjection.js:91:16:91:50 | `^${pro ... r.app$` | provenance | |
4141
| RegExpInjection.js:93:20:93:31 | process.argv | RegExpInjection.js:93:16:93:49 | `^${pro ... r.app$` | provenance | |
42-
| tst.js:1:46:1:46 | e | tst.js:2:16:2:16 | e | provenance | |
43-
| tst.js:2:9:2:21 | data | tst.js:3:21:3:24 | data | provenance | |
44-
| tst.js:2:16:2:16 | e | tst.js:2:9:2:21 | data | provenance | |
45-
| tst.js:3:21:3:24 | data | tst.js:3:16:3:35 | "^"+ data.name + "$" | provenance | |
42+
| tst.js:5:9:5:29 | data | tst.js:6:21:6:24 | data | provenance | |
43+
| tst.js:5:16:5:29 | req.query.data | tst.js:5:9:5:29 | data | provenance | |
44+
| tst.js:6:21:6:24 | data | tst.js:6:16:6:35 | "^"+ data.name + "$" | provenance | |
4645
nodes
4746
| RegExpInjection.js:5:7:5:28 | key | semmle.label | key |
4847
| RegExpInjection.js:5:13:5:28 | req.param("key") | semmle.label | req.param("key") |
@@ -89,11 +88,10 @@ nodes
8988
| RegExpInjection.js:91:20:91:30 | process.env | semmle.label | process.env |
9089
| RegExpInjection.js:93:16:93:49 | `^${pro ... r.app$` | semmle.label | `^${pro ... r.app$` |
9190
| RegExpInjection.js:93:20:93:31 | process.argv | semmle.label | process.argv |
92-
| tst.js:1:46:1:46 | e | semmle.label | e |
93-
| tst.js:2:9:2:21 | data | semmle.label | data |
94-
| tst.js:2:16:2:16 | e | semmle.label | e |
95-
| tst.js:3:16:3:35 | "^"+ data.name + "$" | semmle.label | "^"+ data.name + "$" |
96-
| tst.js:3:21:3:24 | data | semmle.label | data |
91+
| tst.js:5:9:5:29 | data | semmle.label | data |
92+
| tst.js:5:16:5:29 | req.query.data | semmle.label | req.query.data |
93+
| tst.js:6:16:6:35 | "^"+ data.name + "$" | semmle.label | "^"+ data.name + "$" |
94+
| tst.js:6:21:6:24 | data | semmle.label | data |
9795
subpaths
9896
| RegExpInjection.js:11:26:11:26 | s | RegExpInjection.js:14:18:14:18 | s | RegExpInjection.js:15:12:15:24 | s + "=(.*)\\n" | RegExpInjection.js:11:20:11:27 | wrap2(s) |
9997
| RegExpInjection.js:19:19:19:21 | key | RegExpInjection.js:10:17:10:17 | s | RegExpInjection.js:11:12:11:27 | "\\\\b" + wrap2(s) | RegExpInjection.js:19:14:19:22 | wrap(key) |
@@ -116,4 +114,4 @@ subpaths
116114
| RegExpInjection.js:87:14:87:55 | "^.*\\.( ... + ")$" | RegExpInjection.js:82:15:82:32 | req.param("input") | RegExpInjection.js:87:14:87:55 | "^.*\\.( ... + ")$" | This regular expression is constructed from a $@. | RegExpInjection.js:82:15:82:32 | req.param("input") | user-provided value |
117115
| RegExpInjection.js:91:16:91:50 | `^${pro ... r.app$` | RegExpInjection.js:91:20:91:30 | process.env | RegExpInjection.js:91:16:91:50 | `^${pro ... r.app$` | This regular expression is constructed from a $@. | RegExpInjection.js:91:20:91:30 | process.env | environment variable |
118116
| RegExpInjection.js:93:16:93:49 | `^${pro ... r.app$` | RegExpInjection.js:93:20:93:31 | process.argv | RegExpInjection.js:93:16:93:49 | `^${pro ... r.app$` | This regular expression is constructed from a $@. | RegExpInjection.js:93:20:93:31 | process.argv | command-line argument |
119-
| tst.js:3:16:3:35 | "^"+ data.name + "$" | tst.js:1:46:1:46 | e | tst.js:3:16:3:35 | "^"+ data.name + "$" | This regular expression is constructed from a $@. | tst.js:1:46:1:46 | e | user-provided value |
117+
| tst.js:6:16:6:35 | "^"+ data.name + "$" | tst.js:5:16:5:29 | req.query.data | tst.js:6:16:6:35 | "^"+ data.name + "$" | This regular expression is constructed from a $@. | tst.js:5:16:5:29 | req.query.data | user-provided value |

0 commit comments

Comments
 (0)