@@ -16,10 +16,14 @@ import python
1616import experimental.semmle.python.security.injection.RegexInjection
1717import DataFlow:: PathGraph
1818
19- from RegexInjectionFlowConfig config , DataFlow:: PathNode source , DataFlow:: PathNode sink
20- where config .hasFlowPath ( source , sink )
19+ from
20+ RegexInjectionFlowConfig config , DataFlow:: PathNode source , DataFlow:: PathNode sink ,
21+ RegexInjectionSink castedSink , Attribute methodAttribute
22+ where
23+ config .hasFlowPath ( source , sink ) and
24+ castedSink = sink .getNode ( ) and
25+ methodAttribute = castedSink .getRegexMethod ( )
2126select sink .getNode ( ) , source , sink ,
2227 "$@ regular expression is constructed from a $@ and executed by $@." , sink .getNode ( ) , "This" ,
23- source .getNode ( ) , "user-provided value" , sink .getNode ( ) ,
24- sink .getNode ( ) .( RegexInjectionSink ) .getRegexModule ( ) + "." +
25- sink .getNode ( ) .( RegexInjectionSink ) .getRegexMethod ( ) .getName ( )
28+ source .getNode ( ) , "user-provided value" , methodAttribute ,
29+ castedSink .getRegexModule ( ) + "." + methodAttribute .getName ( )
0 commit comments