@@ -119,21 +119,6 @@ private predicate variableStep(Expr tracked, VarAccess sink) {
119119 )
120120}
121121
122- private class ReverseDnsSource extends RemoteFlowSource {
123- ReverseDnsSource ( ) {
124- // Try not to trigger on `localhost`.
125- exists ( MethodCall m | m = this .asExpr ( ) |
126- m .getMethod ( ) instanceof ReverseDnsMethod and
127- not exists ( MethodCall l |
128- ( variableStep ( l , m .getQualifier ( ) ) or l = m .getQualifier ( ) ) and
129- ( l .getMethod ( ) .getName ( ) = "getLocalHost" or l .getMethod ( ) .getName ( ) = "getLoopbackAddress" )
130- )
131- )
132- }
133-
134- override string getSourceType ( ) { result = "reverse DNS lookup" }
135- }
136-
137122private class MessageBodyReaderParameterSource extends RemoteFlowSource {
138123 MessageBodyReaderParameterSource ( ) {
139124 exists ( MessageBodyReaderRead m |
@@ -388,6 +373,24 @@ class AndroidJavascriptInterfaceMethodParameter extends RemoteFlowSource {
388373 }
389374}
390375
376+ /** A node with input that may be controlled by a local user. */
377+ abstract class ReverseDnsUserInput extends UserInput {
378+ override string getThreatModel ( ) { result = "reverse-dns" }
379+ }
380+
381+ private class ReverseDnsSource extends ReverseDnsUserInput {
382+ ReverseDnsSource ( ) {
383+ // Try not to trigger on `localhost`.
384+ exists ( MethodCall m | m = this .asExpr ( ) |
385+ m .getMethod ( ) instanceof ReverseDnsMethod and
386+ not exists ( MethodCall l |
387+ ( variableStep ( l , m .getQualifier ( ) ) or l = m .getQualifier ( ) ) and
388+ ( l .getMethod ( ) .getName ( ) = "getLocalHost" or l .getMethod ( ) .getName ( ) = "getLoopbackAddress" )
389+ )
390+ )
391+ }
392+ }
393+
391394/**
392395 * A data flow source node for an API, which should be considered
393396 * supported for a modeling perspective.
0 commit comments