Skip to content

Commit 33d30a0

Browse files
author
Stephan Brandauer
authored
Merge pull request github#10018 from github/new-atm-features-rebased
New atm features rebased
2 parents 0a7be0b + 1bb781a commit 33d30a0

19 files changed

+63956
-38346
lines changed

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointFeatures.qll

Lines changed: 591 additions & 221 deletions
Large diffs are not rendered by default.

javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/EndpointFeatures.expected

Lines changed: 14631 additions & 11190 deletions
Large diffs are not rendered by default.

javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/ExtractEndpointData.expected

Lines changed: 20111 additions & 11165 deletions
Large diffs are not rendered by default.

javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/ExtractEndpointDataEvaluation.expected

Lines changed: 20111 additions & 11165 deletions
Large diffs are not rendered by default.

javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/ExtractEndpointDataTraining.expected

Lines changed: 7854 additions & 4360 deletions
Large diffs are not rendered by default.

javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_unit_tests/ExtractEndpointData.expected

Lines changed: 198 additions & 110 deletions
Large diffs are not rendered by default.

javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_unit_tests/ExtractEndpointDataEvaluation.expected

Lines changed: 189 additions & 105 deletions
Large diffs are not rendered by default.

javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_unit_tests/ExtractEndpointDataTraining.expected

Lines changed: 54 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -76,51 +76,75 @@ endpoints
7676
| index.js:84:12:84:18 | foo.bar | Xss | notASinkReason | ClientRequest | string |
7777
| index.js:84:12:84:18 | foo.bar | Xss | sinkLabel | NotASink | string |
7878
tokenFeatures
79-
| index.js:9:15:9:45 | { 'isAd ... Admin } | argumentIndex | 0 |
80-
| index.js:9:15:9:45 | { 'isAd ... Admin } | calleeAccessPath | mongoose model find |
81-
| index.js:9:15:9:45 | { 'isAd ... Admin } | calleeAccessPathWithStructuralInfo | mongoose member model instanceorreturn member find instanceorreturn |
82-
| index.js:9:15:9:45 | { 'isAd ... Admin } | calleeApiName | mongoose |
83-
| index.js:9:15:9:45 | { 'isAd ... Admin } | calleeName | find |
79+
| index.js:9:15:9:45 | { 'isAd ... Admin } | CalleeFlexibleAccessPath | User.find |
80+
| index.js:9:15:9:45 | { 'isAd ... Admin } | InputAccessPathFromCallee | |
81+
| index.js:9:15:9:45 | { 'isAd ... Admin } | InputArgumentIndex | 0 |
82+
| index.js:9:15:9:45 | { 'isAd ... Admin } | assignedToPropName | |
83+
| index.js:9:15:9:45 | { 'isAd ... Admin } | calleeImports | mongoose |
84+
| index.js:9:15:9:45 | { 'isAd ... Admin } | contextFunctionInterfaces | constantExpression()\neffectiveSinkAndNotASink(foo)\nflowFromSourceToNotASink()\nflowFromSourceToSink()\nidentity(x)\nnotASink()\nnotASinkMultipleReasons()\nnotConstantExpression()\nnotFlowFromSource()\nveryLongFunctionBody() |
85+
| index.js:9:15:9:45 | { 'isAd ... Admin } | contextSurroundingFunctionParameters | ()\n(req, res) |
8486
| index.js:9:15:9:45 | { 'isAd ... Admin } | enclosingFunctionBody | app post /isAdmin req res User find isAdmin req body isAdmin |
8587
| index.js:9:15:9:45 | { 'isAd ... Admin } | enclosingFunctionName | flowFromSourceToSink |
88+
| index.js:9:15:9:45 | { 'isAd ... Admin } | fileImports | express mongoose |
8689
| index.js:9:15:9:45 | { 'isAd ... Admin } | receiverName | User |
87-
| index.js:15:17:15:32 | req.body.isAdmin | argumentIndex | 0 |
88-
| index.js:15:17:15:32 | req.body.isAdmin | calleeAccessPath | |
89-
| index.js:15:17:15:32 | req.body.isAdmin | calleeAccessPathWithStructuralInfo | |
90-
| index.js:15:17:15:32 | req.body.isAdmin | calleeApiName | |
91-
| index.js:15:17:15:32 | req.body.isAdmin | calleeName | log |
90+
| index.js:9:15:9:45 | { 'isAd ... Admin } | stringConcatenatedWith | |
91+
| index.js:15:17:15:32 | req.body.isAdmin | CalleeFlexibleAccessPath | console.log |
92+
| index.js:15:17:15:32 | req.body.isAdmin | InputAccessPathFromCallee | |
93+
| index.js:15:17:15:32 | req.body.isAdmin | InputArgumentIndex | 0 |
94+
| index.js:15:17:15:32 | req.body.isAdmin | assignedToPropName | |
95+
| index.js:15:17:15:32 | req.body.isAdmin | calleeImports | |
96+
| index.js:15:17:15:32 | req.body.isAdmin | contextFunctionInterfaces | constantExpression()\neffectiveSinkAndNotASink(foo)\nflowFromSourceToNotASink()\nflowFromSourceToSink()\nidentity(x)\nnotASink()\nnotASinkMultipleReasons()\nnotConstantExpression()\nnotFlowFromSource()\nveryLongFunctionBody() |
97+
| index.js:15:17:15:32 | req.body.isAdmin | contextSurroundingFunctionParameters | ()\n(req, res) |
9298
| index.js:15:17:15:32 | req.body.isAdmin | enclosingFunctionBody | app post /isAdmin req res console log req body isAdmin |
9399
| index.js:15:17:15:32 | req.body.isAdmin | enclosingFunctionName | flowFromSourceToNotASink |
100+
| index.js:15:17:15:32 | req.body.isAdmin | fileImports | express mongoose |
94101
| index.js:15:17:15:32 | req.body.isAdmin | receiverName | console |
95-
| index.js:20:13:20:31 | { 'isAdmin': true } | argumentIndex | 0 |
96-
| index.js:20:13:20:31 | { 'isAdmin': true } | calleeAccessPath | mongoose model find |
97-
| index.js:20:13:20:31 | { 'isAdmin': true } | calleeAccessPathWithStructuralInfo | mongoose member model instanceorreturn member find instanceorreturn |
98-
| index.js:20:13:20:31 | { 'isAdmin': true } | calleeApiName | mongoose |
99-
| index.js:20:13:20:31 | { 'isAdmin': true } | calleeName | find |
102+
| index.js:15:17:15:32 | req.body.isAdmin | stringConcatenatedWith | |
103+
| index.js:20:13:20:31 | { 'isAdmin': true } | CalleeFlexibleAccessPath | User.find |
104+
| index.js:20:13:20:31 | { 'isAdmin': true } | InputAccessPathFromCallee | |
105+
| index.js:20:13:20:31 | { 'isAdmin': true } | InputArgumentIndex | 0 |
106+
| index.js:20:13:20:31 | { 'isAdmin': true } | assignedToPropName | |
107+
| index.js:20:13:20:31 | { 'isAdmin': true } | calleeImports | mongoose |
108+
| index.js:20:13:20:31 | { 'isAdmin': true } | contextFunctionInterfaces | constantExpression()\neffectiveSinkAndNotASink(foo)\nflowFromSourceToNotASink()\nflowFromSourceToSink()\nidentity(x)\nnotASink()\nnotASinkMultipleReasons()\nnotConstantExpression()\nnotFlowFromSource()\nveryLongFunctionBody() |
109+
| index.js:20:13:20:31 | { 'isAdmin': true } | contextSurroundingFunctionParameters | () |
100110
| index.js:20:13:20:31 | { 'isAdmin': true } | enclosingFunctionBody | User find isAdmin true |
101111
| index.js:20:13:20:31 | { 'isAdmin': true } | enclosingFunctionName | notFlowFromSource |
112+
| index.js:20:13:20:31 | { 'isAdmin': true } | fileImports | express mongoose |
102113
| index.js:20:13:20:31 | { 'isAdmin': true } | receiverName | User |
103-
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | argumentIndex | 0 |
104-
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | calleeAccessPath | mongoose model find |
105-
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | calleeAccessPathWithStructuralInfo | mongoose member model instanceorreturn member find instanceorreturn |
106-
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | calleeApiName | mongoose |
107-
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | calleeName | find |
114+
| index.js:20:13:20:31 | { 'isAdmin': true } | stringConcatenatedWith | |
115+
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | CalleeFlexibleAccessPath | User.find |
116+
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | InputAccessPathFromCallee | |
117+
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | InputArgumentIndex | 0 |
118+
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | assignedToPropName | |
119+
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | calleeImports | mongoose |
120+
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | contextFunctionInterfaces | constantExpression()\neffectiveSinkAndNotASink(foo)\nflowFromSourceToNotASink()\nflowFromSourceToSink()\nidentity(x)\nnotASink()\nnotASinkMultipleReasons()\nnotConstantExpression()\nnotFlowFromSource()\nveryLongFunctionBody() |
121+
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | contextSurroundingFunctionParameters | () |
108122
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | enclosingFunctionBody | User find UNDEFINED_GLOBAL |
109123
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | enclosingFunctionName | notConstantExpression |
124+
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | fileImports | express mongoose |
110125
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | receiverName | User |
111-
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | argumentIndex | 0 |
112-
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | calleeAccessPath | |
113-
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | calleeAccessPathWithStructuralInfo | |
114-
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | calleeApiName | |
115-
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | calleeName | ajax |
126+
| index.js:28:13:28:28 | UNDEFINED_GLOBAL | stringConcatenatedWith | |
127+
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | CalleeFlexibleAccessPath | $.ajax |
128+
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | InputAccessPathFromCallee | |
129+
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | InputArgumentIndex | 0 |
130+
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | assignedToPropName | |
131+
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | calleeImports | |
132+
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | contextFunctionInterfaces | constantExpression()\neffectiveSinkAndNotASink(foo)\nflowFromSourceToNotASink()\nflowFromSourceToSink()\nidentity(x)\nnotASink()\nnotASinkMultipleReasons()\nnotConstantExpression()\nnotFlowFromSource()\nveryLongFunctionBody() |
133+
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | contextSurroundingFunctionParameters | (foo) |
116134
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | enclosingFunctionBody | foo $ ajax url foo bar |
117135
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | enclosingFunctionName | effectiveSinkAndNotASink |
136+
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | fileImports | express mongoose |
118137
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | receiverName | $ |
119-
| index.js:84:12:84:18 | foo.bar | argumentIndex | |
120-
| index.js:84:12:84:18 | foo.bar | calleeAccessPath | |
121-
| index.js:84:12:84:18 | foo.bar | calleeAccessPathWithStructuralInfo | |
122-
| index.js:84:12:84:18 | foo.bar | calleeApiName | |
123-
| index.js:84:12:84:18 | foo.bar | calleeName | |
138+
| index.js:83:10:85:3 | {\\n " ... ar,\\n } | stringConcatenatedWith | |
139+
| index.js:84:12:84:18 | foo.bar | CalleeFlexibleAccessPath | $.ajax |
140+
| index.js:84:12:84:18 | foo.bar | InputAccessPathFromCallee | 0.url |
141+
| index.js:84:12:84:18 | foo.bar | InputArgumentIndex | 0 |
142+
| index.js:84:12:84:18 | foo.bar | assignedToPropName | url |
143+
| index.js:84:12:84:18 | foo.bar | calleeImports | |
144+
| index.js:84:12:84:18 | foo.bar | contextFunctionInterfaces | constantExpression()\neffectiveSinkAndNotASink(foo)\nflowFromSourceToNotASink()\nflowFromSourceToSink()\nidentity(x)\nnotASink()\nnotASinkMultipleReasons()\nnotConstantExpression()\nnotFlowFromSource()\nveryLongFunctionBody() |
145+
| index.js:84:12:84:18 | foo.bar | contextSurroundingFunctionParameters | (foo) |
124146
| index.js:84:12:84:18 | foo.bar | enclosingFunctionBody | foo $ ajax url foo bar |
125147
| index.js:84:12:84:18 | foo.bar | enclosingFunctionName | effectiveSinkAndNotASink |
148+
| index.js:84:12:84:18 | foo.bar | fileImports | express mongoose |
126149
| index.js:84:12:84:18 | foo.bar | receiverName | |
150+
| index.js:84:12:84:18 | foo.bar | stringConcatenatedWith | |

javascript/ql/experimental/adaptivethreatmodeling/test/generic_feature_testing/EmptyFeature.expected

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import javascript
2+
import experimental.adaptivethreatmodeling.EndpointFeatures
3+
import experimental.adaptivethreatmodeling.FeaturizationConfig
4+
import TestUtil
5+
6+
// every feature must produce a value for at least one endpoint, otherwise the feature is completely broken, or a relevant test example is missing
7+
from EndpointFeature feature
8+
where forall(Endpoint endpoint | not exists(feature.getValue(endpoint)))
9+
select feature.getName()

0 commit comments

Comments
 (0)