@@ -15,28 +15,22 @@ class PropagateToSinkConfiguration extends TaintTracking::Configuration {
1515 PropagateToSinkConfiguration ( ) { this = "public methods calling sinks" }
1616
1717 override predicate isSource ( DataFlow:: Node source ) {
18- exists ( MethodAccess ma |
19- ma .getAChildExpr ( ) = source .asExpr ( ) and
20- ma .getAnEnclosingStmt ( ) .getEnclosingCallable ( ) .isPublic ( ) and
21- ma .getAnEnclosingStmt ( ) .getEnclosingCallable ( ) .fromSource ( )
22- )
18+ source .asParameter ( ) .getCallable ( ) .isPublic ( )
2319 }
2420
2521 override predicate isSink ( DataFlow:: Node sink ) { sinkNode ( sink , _) }
2622}
2723
28- string asInputArgument ( Expr source ) {
29- result = "Argument[" + source .( Argument ) .getPosition ( ) + "]"
30- or
31- result = "Argument[" + source .( VarAccess ) .getVariable ( ) .( Parameter ) .getPosition ( ) + "]"
24+ string asInputArgument ( DataFlow:: Node source ) {
25+ result = "Argument[" + source .asParameter ( ) .getPosition ( ) + "]"
3226}
3327
3428string captureSink ( Callable api ) {
3529 exists ( DataFlow:: Node src , DataFlow:: Node sink , PropagateToSinkConfiguration config , string kind |
3630 config .hasFlow ( src , sink ) and
3731 sinkNode ( sink , kind ) and
38- api = src .asExpr ( ) .getEnclosingCallable ( ) and
39- result = asSinkModel ( api , asInputArgument ( src . asExpr ( ) ) , kind )
32+ api = src .asParameter ( ) .getCallable ( ) and
33+ result = asSinkModel ( api , asInputArgument ( src ) , kind )
4034 )
4135}
4236
0 commit comments