@@ -70,7 +70,8 @@ module Revel {
7070 exists ( string fieldName |
7171 this .getField ( ) .hasQualifiedName ( packagePath ( ) , "Request" , fieldName )
7272 |
73- fieldName in [ "In" , "Header" , "URL" , "Form" , "MultipartForm" ]
73+ fieldName in [ "Header" , "ContentType" , "AcceptLanguages" , "Locale" , "URL" , "Form" ,
74+ "MultipartForm" ]
7475 )
7576 }
7677 }
@@ -81,38 +82,30 @@ module Revel {
8182 this
8283 .getTarget ( )
8384 .hasQualifiedName ( packagePath ( ) , "Request" ,
84- [ "FormValue" , "PostFormValue" , "GetQuery" , "GetForm" , "GetMultipartForm" , "GetBody" ] )
85+ [ "FormValue" , "PostFormValue" , "GetQuery" , "GetForm" , "GetMultipartForm" , "GetBody" ,
86+ "Cookie" , "GetHttpHeader" , "GetRequestURI" , "MultipartReader" , "Referer" ,
87+ "UserAgent" ] )
8588 }
8689 }
8790
88- private class ServerMultipartFormGetFiles extends TaintTracking:: FunctionModel , Method {
89- ServerMultipartFormGetFiles ( ) {
90- this .hasQualifiedName ( packagePath ( ) , "ServerMultipartForm" , "GetFiles" )
91- }
91+ private class ServerCookieGetValue extends TaintTracking:: FunctionModel , Method {
92+ ServerCookieGetValue ( ) { this .hasQualifiedName ( packagePath ( ) , "ServerCookie" , "GetValue" ) }
9293
9394 override predicate hasTaintFlow ( FunctionInput inp , FunctionOutput outp ) {
9495 inp .isReceiver ( ) and outp .isResult ( )
9596 }
9697 }
9798
98- private class ServerMultipartFormGetValues extends TaintTracking:: FunctionModel , Method {
99- ServerMultipartFormGetValues ( ) {
100- this .hasQualifiedName ( packagePath ( ) , "ServerMultipartForm" , " GetValues")
99+ private class ServerMultipartFormGetFiles extends TaintTracking:: FunctionModel , Method {
100+ ServerMultipartFormGetFiles ( ) {
101+ this .hasQualifiedName ( packagePath ( ) , "ServerMultipartForm" , [ "GetFiles" , " GetValues"] )
101102 }
102103
103104 override predicate hasTaintFlow ( FunctionInput inp , FunctionOutput outp ) {
104105 inp .isReceiver ( ) and outp .isResult ( )
105106 }
106107 }
107108
108- private class ServerRequestGet extends TaintTracking:: FunctionModel , Method {
109- ServerRequestGet ( ) { this .hasQualifiedName ( packagePath ( ) , "ServerRequest" , "Get" ) }
110-
111- override predicate hasTaintFlow ( FunctionInput inp , FunctionOutput outp ) {
112- inp .isReceiver ( ) and outp .isResult ( 0 )
113- }
114- }
115-
116109 private string contentTypeFromFilename ( DataFlow:: Node filename ) {
117110 if filename .getStringValue ( ) .toLowerCase ( ) .matches ( [ "%.htm" , "%.html" ] )
118111 then result = "text/html"
@@ -183,8 +176,8 @@ module Revel {
183176 * We extend FileSystemAccess rather than HTTP::ResponseBody as this will usually mean exposing a user-controlled
184177 * file rather than the actual contents being user-controlled.
185178 */
186- private class IoUtilFileSystemAccess extends FileSystemAccess:: Range , DataFlow:: CallNode {
187- IoUtilFileSystemAccess ( ) {
179+ private class RenderFileNameCall extends FileSystemAccess:: Range , DataFlow:: CallNode {
180+ RenderFileNameCall ( ) {
188181 this =
189182 any ( Method m | m .hasQualifiedName ( packagePath ( ) , "Controller" , "RenderFileName" ) ) .getACall ( )
190183 }
@@ -195,8 +188,8 @@ module Revel {
195188 /**
196189 * The `revel.Controller.Redirect` method.
197190 *
198- * For now I assume that in the context `Redirect(url, value)`, where Revel will `Sprintf(url, value)` internally,
199- * it is very likely `url` imposes some mandatory prefix, so `value` isn't truly an open redirect opportunity .
191+ * It is currently assumed that a tainted `value` in `Redirect(url, value)`, which calls `Sprintf(url, value)`
192+ * internally, cannot lead to an open redirect vulnerability .
200193 */
201194 private class ControllerRedirectMethod extends HTTP:: Redirect:: Range , DataFlow:: CallNode {
202195 ControllerRedirectMethod ( ) {
0 commit comments