@@ -42,11 +42,28 @@ private module Cached {
42
42
*/
43
43
cached
44
44
predicate localTaintStep ( DataFlow:: Node src , DataFlow:: Node sink ) {
45
- DataFlow:: localFlowStep ( src , sink ) or
46
- localAdditionalTaintStep ( src , sink ) or
45
+ DataFlow:: localFlowStep ( src , sink )
46
+ or
47
+ localAdditionalTaintStep ( src , sink )
48
+ or
47
49
// Simple flow through library code is included in the exposed local
48
50
// step relation, even though flow is technically inter-procedural
49
51
FlowSummaryImpl:: Private:: Steps:: summaryThroughStep ( src , sink , false )
52
+ or
53
+ // Treat container flow as taint for the local taint flow relation
54
+ exists ( DataFlow:: Content c | containerContent ( c ) |
55
+ readStep ( src , c , sink ) or
56
+ storeStep ( src , c , sink ) or
57
+ FlowSummaryImpl:: Private:: Steps:: summaryGetterStep ( src , c , sink ) or
58
+ FlowSummaryImpl:: Private:: Steps:: summarySetterStep ( src , c , sink )
59
+ )
60
+ }
61
+
62
+ private predicate containerContent ( DataFlow:: Content c ) {
63
+ c instanceof DataFlow:: ArrayContent or
64
+ c instanceof DataFlow:: CollectionContent or
65
+ c instanceof DataFlow:: MapKeyContent or
66
+ c instanceof DataFlow:: MapValueContent
50
67
}
51
68
52
69
/**
@@ -65,12 +82,8 @@ private module Cached {
65
82
readStep ( src , f , sink ) and
66
83
not sink .getTypeBound ( ) instanceof PrimitiveType and
67
84
not sink .getTypeBound ( ) instanceof BoxedType and
68
- not sink .getTypeBound ( ) instanceof NumberType
69
- |
70
- f instanceof DataFlow:: ArrayContent or
71
- f instanceof DataFlow:: CollectionContent or
72
- f instanceof DataFlow:: MapKeyContent or
73
- f instanceof DataFlow:: MapValueContent
85
+ not sink .getTypeBound ( ) instanceof NumberType and
86
+ containerContent ( f )
74
87
)
75
88
or
76
89
FlowSummaryImpl:: Private:: Steps:: summaryLocalStep ( src , sink , false )
0 commit comments