@@ -383,48 +383,13 @@ private predicate taintPreservingArgumentToMethod(Method method, int arg) {
383383 */
384384private predicate argToArgStep ( Expr tracked , Expr sink ) {
385385 exists ( MethodAccess ma , Method method , int input , int output |
386- taintPreservingArgToArg ( method , argToParam ( ma , input ) , argToParam ( ma , output ) ) and
386+ method . ( TaintPreservingCallable ) . transfersTaint ( argToParam ( ma , input ) , argToParam ( ma , output ) ) and
387387 ma .getMethod ( ) = method and
388388 ma .getArgument ( input ) = tracked and
389389 ma .getArgument ( output ) = sink
390390 )
391391}
392392
393- /**
394- * Holds if `method` is a library method that writes tainted data to the
395- * `output`th argument if the `input`th argument is tainted.
396- */
397- private predicate taintPreservingArgToArg ( Method method , int input , int output ) {
398- method .getDeclaringType ( ) .hasQualifiedName ( "org.apache.commons.io" , "IOUtils" ) and
399- (
400- method .hasName ( "copy" ) and input = 0 and output = 1
401- or
402- method .hasName ( "copyLarge" ) and input = 0 and output = 1
403- or
404- method .hasName ( "read" ) and input = 0 and output = 1
405- or
406- method .hasName ( "readFully" ) and
407- input = 0 and
408- output = 1 and
409- not method .getParameterType ( 1 ) .hasName ( "int" )
410- or
411- method .hasName ( "write" ) and input = 0 and output = 1
412- or
413- method .hasName ( "writeChunked" ) and input = 0 and output = 1
414- or
415- method .hasName ( "writeLines" ) and input = 0 and output = 2
416- or
417- method .hasName ( "writeLines" ) and input = 1 and output = 2
418- )
419- or
420- method .getDeclaringType ( ) .hasQualifiedName ( "java.lang" , "System" ) and
421- method .hasName ( "arraycopy" ) and
422- input = 0 and
423- output = 2
424- or
425- method .( TaintPreservingCallable ) .transfersTaint ( input , output )
426- }
427-
428393/**
429394 * Holds if `tracked` is the argument of a method that transfers taint
430395 * from the argument to the qualifier and `sink` is the qualifier.
0 commit comments