@@ -143,11 +143,19 @@ private class NosqlInjectionSinkCharacteristic extends EndpointCharacteristic {
143
143
* negative samples for training.
144
144
*/
145
145
146
+ /**
147
+ * A characteristic that is an indicator of not being a sink of any type, because it's a modeled argument.
148
+ */
149
+ abstract class OtherModeledArgumentCharacteristic extends EndpointCharacteristic {
150
+ bindingset [ this ]
151
+ OtherModeledArgumentCharacteristic ( ) { any ( ) }
152
+ }
153
+
146
154
/**
147
155
* A characteristic that is an indicator of not being a sink of any type, because it's an argument to a function of a
148
156
* builtin object.
149
157
*/
150
- abstract private class ArgumentToBuiltinFunctionCharacteristic extends EndpointCharacteristic {
158
+ abstract private class ArgumentToBuiltinFunctionCharacteristic extends OtherModeledArgumentCharacteristic {
151
159
bindingset [ this ]
152
160
ArgumentToBuiltinFunctionCharacteristic ( ) { any ( ) }
153
161
}
@@ -187,23 +195,26 @@ abstract class LikelyNotASinkCharacteristic extends EndpointCharacteristic {
187
195
}
188
196
}
189
197
190
- private class LodashUnderscore extends NotASinkCharacteristic {
191
- LodashUnderscore ( ) { this = "LodashUnderscoreArgument" }
198
+ private class LodashUnderscoreCharacteristic extends NotASinkCharacteristic ,
199
+ OtherModeledArgumentCharacteristic {
200
+ LodashUnderscoreCharacteristic ( ) { this = "LodashUnderscoreArgument" }
192
201
193
202
override predicate getEndpoints ( DataFlow:: Node n ) {
194
203
any ( LodashUnderscore:: Member m ) .getACall ( ) .getAnArgument ( ) = n
195
204
}
196
205
}
197
206
198
- private class JQueryArgumentCharacteristic extends NotASinkCharacteristic {
207
+ private class JQueryArgumentCharacteristic extends NotASinkCharacteristic ,
208
+ OtherModeledArgumentCharacteristic {
199
209
JQueryArgumentCharacteristic ( ) { this = "JQueryArgument" }
200
210
201
211
override predicate getEndpoints ( DataFlow:: Node n ) {
202
212
any ( JQuery:: MethodCall m ) .getAnArgument ( ) = n
203
213
}
204
214
}
205
215
206
- private class ClientRequestCharacteristic extends NotASinkCharacteristic {
216
+ private class ClientRequestCharacteristic extends NotASinkCharacteristic ,
217
+ OtherModeledArgumentCharacteristic {
207
218
ClientRequestCharacteristic ( ) { this = "ClientRequest" }
208
219
209
220
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -213,7 +224,8 @@ private class ClientRequestCharacteristic extends NotASinkCharacteristic {
213
224
}
214
225
}
215
226
216
- private class PromiseDefinitionCharacteristic extends NotASinkCharacteristic {
227
+ private class PromiseDefinitionCharacteristic extends NotASinkCharacteristic ,
228
+ OtherModeledArgumentCharacteristic {
217
229
PromiseDefinitionCharacteristic ( ) { this = "PromiseDefinition" }
218
230
219
231
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -223,21 +235,24 @@ private class PromiseDefinitionCharacteristic extends NotASinkCharacteristic {
223
235
}
224
236
}
225
237
226
- private class CryptographicKeyCharacteristic extends NotASinkCharacteristic {
238
+ private class CryptographicKeyCharacteristic extends NotASinkCharacteristic ,
239
+ OtherModeledArgumentCharacteristic {
227
240
CryptographicKeyCharacteristic ( ) { this = "CryptographicKey" }
228
241
229
242
override predicate getEndpoints ( DataFlow:: Node n ) { n instanceof CryptographicKey }
230
243
}
231
244
232
- private class CryptographicOperationFlowCharacteristic extends NotASinkCharacteristic {
245
+ private class CryptographicOperationFlowCharacteristic extends NotASinkCharacteristic ,
246
+ OtherModeledArgumentCharacteristic {
233
247
CryptographicOperationFlowCharacteristic ( ) { this = "CryptographicOperationFlow" }
234
248
235
249
override predicate getEndpoints ( DataFlow:: Node n ) {
236
250
any ( CryptographicOperation op ) .getInput ( ) = n
237
251
}
238
252
}
239
253
240
- private class LoggerMethodCharacteristic extends NotASinkCharacteristic {
254
+ private class LoggerMethodCharacteristic extends NotASinkCharacteristic ,
255
+ OtherModeledArgumentCharacteristic {
241
256
LoggerMethodCharacteristic ( ) { this = "LoggerMethod" }
242
257
243
258
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -247,7 +262,8 @@ private class LoggerMethodCharacteristic extends NotASinkCharacteristic {
247
262
}
248
263
}
249
264
250
- private class TimeoutCharacteristic extends NotASinkCharacteristic {
265
+ private class TimeoutCharacteristic extends NotASinkCharacteristic ,
266
+ OtherModeledArgumentCharacteristic {
251
267
TimeoutCharacteristic ( ) { this = "Timeout" }
252
268
253
269
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -257,7 +273,8 @@ private class TimeoutCharacteristic extends NotASinkCharacteristic {
257
273
}
258
274
}
259
275
260
- private class ReceiverStorageCharacteristic extends NotASinkCharacteristic {
276
+ private class ReceiverStorageCharacteristic extends NotASinkCharacteristic ,
277
+ OtherModeledArgumentCharacteristic {
261
278
ReceiverStorageCharacteristic ( ) { this = "ReceiverStorage" }
262
279
263
280
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -267,7 +284,8 @@ private class ReceiverStorageCharacteristic extends NotASinkCharacteristic {
267
284
}
268
285
}
269
286
270
- private class StringStartsWithCharacteristic extends NotASinkCharacteristic {
287
+ private class StringStartsWithCharacteristic extends NotASinkCharacteristic ,
288
+ OtherModeledArgumentCharacteristic {
271
289
StringStartsWithCharacteristic ( ) { this = "StringStartsWith" }
272
290
273
291
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -277,15 +295,17 @@ private class StringStartsWithCharacteristic extends NotASinkCharacteristic {
277
295
}
278
296
}
279
297
280
- private class StringEndsWithCharacteristic extends NotASinkCharacteristic {
298
+ private class StringEndsWithCharacteristic extends NotASinkCharacteristic ,
299
+ OtherModeledArgumentCharacteristic {
281
300
StringEndsWithCharacteristic ( ) { this = "StringEndsWith" }
282
301
283
302
override predicate getEndpoints ( DataFlow:: Node n ) {
284
303
exists ( DataFlow:: CallNode call | n = call .getAnArgument ( ) | call instanceof StringOps:: EndsWith )
285
304
}
286
305
}
287
306
288
- private class StringRegExpTestCharacteristic extends NotASinkCharacteristic {
307
+ private class StringRegExpTestCharacteristic extends NotASinkCharacteristic ,
308
+ OtherModeledArgumentCharacteristic {
289
309
StringRegExpTestCharacteristic ( ) { this = "StringRegExpTest" }
290
310
291
311
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -295,23 +315,26 @@ private class StringRegExpTestCharacteristic extends NotASinkCharacteristic {
295
315
}
296
316
}
297
317
298
- private class EventRegistrationCharacteristic extends NotASinkCharacteristic {
318
+ private class EventRegistrationCharacteristic extends NotASinkCharacteristic ,
319
+ OtherModeledArgumentCharacteristic {
299
320
EventRegistrationCharacteristic ( ) { this = "EventRegistration" }
300
321
301
322
override predicate getEndpoints ( DataFlow:: Node n ) {
302
323
exists ( DataFlow:: CallNode call | n = call .getAnArgument ( ) | call instanceof EventRegistration )
303
324
}
304
325
}
305
326
306
- private class EventDispatchCharacteristic extends NotASinkCharacteristic {
327
+ private class EventDispatchCharacteristic extends NotASinkCharacteristic ,
328
+ OtherModeledArgumentCharacteristic {
307
329
EventDispatchCharacteristic ( ) { this = "EventDispatch" }
308
330
309
331
override predicate getEndpoints ( DataFlow:: Node n ) {
310
332
exists ( DataFlow:: CallNode call | n = call .getAnArgument ( ) | call instanceof EventDispatch )
311
333
}
312
334
}
313
335
314
- private class MembershipCandidateTestCharacteristic extends NotASinkCharacteristic {
336
+ private class MembershipCandidateTestCharacteristic extends NotASinkCharacteristic ,
337
+ OtherModeledArgumentCharacteristic {
315
338
MembershipCandidateTestCharacteristic ( ) { this = "MembershipCandidateTest" }
316
339
317
340
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -321,15 +344,17 @@ private class MembershipCandidateTestCharacteristic extends NotASinkCharacterist
321
344
}
322
345
}
323
346
324
- private class FileSystemAccessCharacteristic extends NotASinkCharacteristic {
347
+ private class FileSystemAccessCharacteristic extends NotASinkCharacteristic ,
348
+ OtherModeledArgumentCharacteristic {
325
349
FileSystemAccessCharacteristic ( ) { this = "FileSystemAccess" }
326
350
327
351
override predicate getEndpoints ( DataFlow:: Node n ) {
328
352
exists ( DataFlow:: CallNode call | n = call .getAnArgument ( ) | call instanceof FileSystemAccess )
329
353
}
330
354
}
331
355
332
- private class DatabaseAccessCharacteristic extends NotASinkCharacteristic {
356
+ private class DatabaseAccessCharacteristic extends NotASinkCharacteristic ,
357
+ OtherModeledArgumentCharacteristic {
333
358
DatabaseAccessCharacteristic ( ) { this = "DatabaseAccess" }
334
359
335
360
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -344,15 +369,16 @@ private class DatabaseAccessCharacteristic extends NotASinkCharacteristic {
344
369
}
345
370
}
346
371
347
- private class DomCharacteristic extends NotASinkCharacteristic {
372
+ private class DomCharacteristic extends NotASinkCharacteristic , OtherModeledArgumentCharacteristic {
348
373
DomCharacteristic ( ) { this = "DOM" }
349
374
350
375
override predicate getEndpoints ( DataFlow:: Node n ) {
351
376
exists ( DataFlow:: CallNode call | n = call .getAnArgument ( ) | call = DOM:: domValueRef ( ) )
352
377
}
353
378
}
354
379
355
- private class NextFunctionCallCharacteristic extends NotASinkCharacteristic {
380
+ private class NextFunctionCallCharacteristic extends NotASinkCharacteristic ,
381
+ OtherModeledArgumentCharacteristic {
356
382
NextFunctionCallCharacteristic ( ) { this = "NextFunctionCall" }
357
383
358
384
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -363,7 +389,8 @@ private class NextFunctionCallCharacteristic extends NotASinkCharacteristic {
363
389
}
364
390
}
365
391
366
- private class DojoRequireCharacteristic extends NotASinkCharacteristic {
392
+ private class DojoRequireCharacteristic extends NotASinkCharacteristic ,
393
+ OtherModeledArgumentCharacteristic {
367
394
DojoRequireCharacteristic ( ) { this = "DojoRequire" }
368
395
369
396
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -373,7 +400,8 @@ private class DojoRequireCharacteristic extends NotASinkCharacteristic {
373
400
}
374
401
}
375
402
376
- private class Base64ManipulationCharacteristic extends NotASinkCharacteristic {
403
+ private class Base64ManipulationCharacteristic extends NotASinkCharacteristic ,
404
+ OtherModeledArgumentCharacteristic {
377
405
Base64ManipulationCharacteristic ( ) { this = "Base64Manipulation" }
378
406
379
407
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -475,7 +503,7 @@ abstract private class StandardEndpointFilterCharacteristic extends EndpointFilt
475
503
}
476
504
}
477
505
478
- private class IsArgumentToModeledFunctionCharacteristic extends StandardEndpointFilterCharacteristic {
506
+ class IsArgumentToModeledFunctionCharacteristic extends StandardEndpointFilterCharacteristic {
479
507
IsArgumentToModeledFunctionCharacteristic ( ) { this = "argument to modeled function" }
480
508
481
509
override predicate getEndpoints ( DataFlow:: Node n ) {
@@ -487,7 +515,9 @@ private class IsArgumentToModeledFunctionCharacteristic extends StandardEndpoint
487
515
or
488
516
CoreKnowledge:: isKnownStepSrc ( known )
489
517
or
490
- CoreKnowledge:: isOtherModeledArgument ( known , _)
518
+ exists ( OtherModeledArgumentCharacteristic characteristic |
519
+ characteristic .getEndpoints ( known )
520
+ )
491
521
)
492
522
)
493
523
}
0 commit comments