@@ -68,9 +68,11 @@ predicate localAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeT
6868 )
6969 or
7070 // Taint can flow through modeled functions
71+ exprToExprStep ( nodeFrom .asExpr ( ) , nodeTo .asExpr ( ) )
72+ or
7173 exprToDefinitionByReferenceStep ( nodeFrom .asExpr ( ) , nodeTo .asDefiningArgument ( ) )
7274 or
73- exprToExprStep ( nodeFrom .asExpr ( ) , nodeTo .asExpr ( ) )
75+ exprToPartialDefinitionStep ( nodeFrom .asExpr ( ) , nodeTo .asPartialDefinition ( ) )
7476}
7577
7678/**
@@ -187,3 +189,24 @@ private predicate exprToDefinitionByReferenceStep(Expr exprIn, Expr argOut) {
187189 )
188190 )
189191}
192+
193+ private predicate exprToPartialDefinitionStep ( Expr exprIn , Expr exprOut ) {
194+ exists ( TaintFunction f , Call call , FunctionInput inModel , FunctionOutput outModel |
195+ call .getTarget ( ) = f and
196+ (
197+ exprOut = call .getQualifier ( ) and
198+ outModel .isQualifierObject ( )
199+ ) and
200+ f .hasTaintFlow ( inModel , outModel ) and
201+ exists ( int argInIndex |
202+ inModel .isParameterDeref ( argInIndex ) and
203+ exprIn = call .getArgument ( argInIndex )
204+ or
205+ inModel .isParameterDeref ( argInIndex ) and
206+ call .passesByReference ( argInIndex , exprIn )
207+ or
208+ inModel .isParameter ( argInIndex ) and
209+ exprIn = call .getArgument ( argInIndex )
210+ )
211+ )
212+ }
0 commit comments