File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
python/ql/src/experimental/semmle/python/security Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -292,6 +292,25 @@ class UserInputInComparisonConfig extends TaintTracking2::Configuration {
292
292
}
293
293
}
294
294
295
+ /**
296
+ * A configuration tracing flow from a client Secret obtained by an HTTP header to a len() function.
297
+ */
298
+ private class ExcludeLenFunc extends TaintTracking2:: Configuration {
299
+ ExcludeLenFunc ( ) { this = "ExcludeLenFunc" }
300
+
301
+ override predicate isSource ( DataFlow:: Node source ) { source instanceof ClientSuppliedSecret }
302
+
303
+ override predicate isSink ( DataFlow:: Node sink ) {
304
+ exists ( Call call |
305
+ call .getFunc ( ) .( Name ) .getId ( ) = "len" and
306
+ sink .asExpr ( ) = call .getArg ( 0 )
307
+ )
308
+ }
309
+ }
310
+
311
+ /**
312
+ * Holds if there is a fast-fail check.
313
+ */
295
314
private class CompareSink extends DataFlow:: Node {
296
315
CompareSink ( ) {
297
316
exists ( Compare compare |
@@ -321,4 +340,13 @@ private class CompareSink extends DataFlow::Node {
321
340
)
322
341
)
323
342
}
343
+
344
+ /**
345
+ * Holds if there is a flow to len().
346
+ */
347
+ predicate FlowToLen ( ) {
348
+ exists ( ExcludeLenFunc config , DataFlow2:: PathNode source , DataFlow2:: PathNode sink |
349
+ config .hasFlowPath ( source , sink )
350
+ )
351
+ }
324
352
}
You can’t perform that action at this time.
0 commit comments