@@ -116,6 +116,23 @@ class AspNetServiceRemoteFlowSource extends AspNetRemoteFlowSource, DataFlow::Pa
116116 override string getSourceType ( ) { result = "ASP.NET web service input" }
117117}
118118
119+ private class CandidateMembersToTaint extends Member {
120+ CandidateMembersToTaint ( ) {
121+ this .isPublic ( ) and
122+ not this .isStatic ( ) and
123+ (
124+ this =
125+ any ( Property p |
126+ p .isAutoImplemented ( ) and
127+ p .getGetter ( ) .isPublic ( ) and
128+ p .getSetter ( ) .isPublic ( )
129+ )
130+ or
131+ this = any ( Field f | f .isPublic ( ) )
132+ )
133+ }
134+ }
135+
119136/**
120137 * Taint members (transitively) on types used in
121138 * 1. Action method parameters.
@@ -124,7 +141,9 @@ class AspNetServiceRemoteFlowSource extends AspNetRemoteFlowSource, DataFlow::Pa
124141 * Note, as this also impact uses of such types in other contexts, we only do this for
125142 * user-defined types.
126143 */
127- private class AspNetRemoteFlowSourceMember extends TaintTracking:: TaintedMember {
144+ private class AspNetRemoteFlowSourceMember extends TaintTracking:: TaintedMember ,
145+ CandidateMembersToTaint
146+ {
128147 AspNetRemoteFlowSourceMember ( ) {
129148 exists ( Type t , Type t0 | t = this .getDeclaringType ( ) and t .fromSource ( ) |
130149 ( t = t0 or t = t0 .( ArrayType ) .getElementType ( ) ) and
@@ -135,18 +154,6 @@ private class AspNetRemoteFlowSourceMember extends TaintTracking::TaintedMember
135154 or
136155 t0 = any ( AspNetServiceRemoteFlowSource source ) .getType ( )
137156 )
138- ) and
139- this .isPublic ( ) and
140- not this .isStatic ( ) and
141- (
142- this =
143- any ( Property p |
144- p .isAutoImplemented ( ) and
145- p .getGetter ( ) .isPublic ( ) and
146- p .getSetter ( ) .isPublic ( )
147- )
148- or
149- this = any ( Field f | f .isPublic ( ) )
150157 )
151158 }
152159}
@@ -255,14 +262,18 @@ class AspNetCoreRoutingMethodParameter extends AspNetCoreRemoteFlowSource, DataF
255262 * Flow is defined from any ASP.NET Core remote source object to any of its member
256263 * properties.
257264 */
258- private class AspNetCoreRemoteFlowSourceMember extends TaintTracking:: TaintedMember , Property {
265+ private class AspNetCoreRemoteFlowSourceMember extends TaintTracking:: TaintedMember ,
266+ CandidateMembersToTaint
267+ {
259268 AspNetCoreRemoteFlowSourceMember ( ) {
260- this .getDeclaringType ( ) = any ( AspNetCoreRemoteFlowSource source ) .getType ( ) and
261- this .isPublic ( ) and
262- not this .isStatic ( ) and
263- this .isAutoImplemented ( ) and
264- this .getGetter ( ) .isPublic ( ) and
265- this .getSetter ( ) .isPublic ( )
269+ exists ( Type t , Type t0 | t = this .getDeclaringType ( ) and t .fromSource ( ) |
270+ ( t = t0 or t = t0 .( ArrayType ) .getElementType ( ) ) and
271+ (
272+ t0 = any ( AspNetCoreRemoteFlowSourceMember m ) .getType ( )
273+ or
274+ t0 = any ( AspNetCoreRemoteFlowSource m ) .getType ( )
275+ )
276+ )
266277 }
267278}
268279
0 commit comments