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 {
292292 }
293293}
294294
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+ */
295314private class CompareSink extends DataFlow:: Node {
296315 CompareSink ( ) {
297316 exists ( Compare compare |
@@ -321,4 +340,13 @@ private class CompareSink extends DataFlow::Node {
321340 )
322341 )
323342 }
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+ }
324352}
You can’t perform that action at this time.
0 commit comments