@@ -23,11 +23,15 @@ class BeegoFileSystemAccess extends FileSystemAccess::Range, DataFlow::CallNode
23
23
BeegoFileSystemAccess ( ) {
24
24
exists ( Method m |
25
25
(
26
- m .hasQualifiedName ( package ( "github.com/beego/beego" , "server/web/context" ) , "BeegoOutput" ,
27
- "Download" ) and
26
+ (
27
+ m .hasQualifiedName ( [ "github.com/beego/beego/context" , "github.com/astaxie/beego/context" ] ,
28
+ "BeegoOutput" , "Download" ) or
29
+ m .hasQualifiedName ( "github.com/beego/beego/v2/server/web/context" , "BeegoOutput" ,
30
+ "Download" )
31
+ ) and
28
32
pathArg = 0
29
33
or
30
- m .hasQualifiedName ( package ( "github.com/beego/beego" , " server/web") , "Controller" ,
34
+ m .hasQualifiedName ( "github.com/beego/beego/v2/ server/web" , "Controller" ,
31
35
"SaveToFileWithBuffer" ) and
32
36
pathArg = 1
33
37
) and
@@ -91,7 +95,7 @@ class IrisFileSystemAccess extends FileSystemAccess::Range, DataFlow::CallNode {
91
95
[ "SendFile" , "ServeFile" , "SendFileWithRate" , "ServeFileWithRate" , "UploadFormFiles" ] ) and
92
96
pathArg = 0
93
97
or
94
- m .hasQualifiedName ( package ( "github.com/kataras/iris" , " context") , "Context" , "SaveFormFile" ) and
98
+ m .hasQualifiedName ( "github.com/kataras/iris/v12/ context" , "Context" , "SaveFormFile" ) and
95
99
pathArg = 1
96
100
) and
97
101
this = m .getACall ( )
@@ -110,11 +114,14 @@ class FiberSystemAccess extends FileSystemAccess::Range, DataFlow::CallNode {
110
114
FiberSystemAccess ( ) {
111
115
exists ( Method m |
112
116
(
113
- m .hasQualifiedName ( package ( "github.com/gofiber/fiber" , "" ) , "Ctx" , "SendFile" ) and
117
+ m .hasQualifiedName ( package ( "github.com/gofiber/fiber" , "" ) , "Ctx" , [ "SendFile" , "Download" ] ) and
114
118
pathArg = 0
115
119
or
116
120
m .hasQualifiedName ( package ( "github.com/gofiber/fiber" , "" ) , "Ctx" , "SaveFile" ) and
117
121
pathArg = 1
122
+ or
123
+ m .hasQualifiedName ( "github.com/gofiber/fiber/v2" , "Ctx" , "SaveFileToStorage" ) and
124
+ pathArg = 1
118
125
) and
119
126
this = m .getACall ( )
120
127
)
@@ -127,6 +134,9 @@ class FiberSystemAccess extends FileSystemAccess::Range, DataFlow::CallNode {
127
134
* Provide File system access sinks of [afero](https://github.com/spf13/afero) framework
128
135
*/
129
136
module Afero {
137
+ /**
138
+ * Gets all versions of `github.com/spf13/afero`
139
+ */
130
140
string aferoPackage ( ) { result = package ( "github.com/spf13/afero" , "" ) }
131
141
132
142
/**
@@ -207,7 +217,7 @@ module Afero {
207
217
predicate aferoSanitizer ( DataFlow:: Node n ) {
208
218
exists ( Function f |
209
219
f .hasQualifiedName ( aferoPackage ( ) , [ "NewBasePathFs" , "NewIOFS" ] ) and
210
- TaintTracking :: localTaint ( f .getACall ( ) , n )
220
+ DataFlow :: localFlow ( f .getACall ( ) , n )
211
221
)
212
222
}
213
223
@@ -221,7 +231,8 @@ module Afero {
221
231
predicate additionalTaintStep ( DataFlow:: Node n1 , DataFlow:: Node n2 ) {
222
232
exists ( StructLit st | st .getType ( ) .hasQualifiedName ( aferoPackage ( ) , "Afero" ) |
223
233
n1 .asExpr ( ) = st .getAChildExpr ( ) .( KeyValueExpr ) .getAChildExpr ( ) and
224
- n2 .asExpr ( ) = st .getParent ( )
234
+ not aferoSanitizer ( n1 ) and
235
+ n2 .asExpr ( ) = st
225
236
)
226
237
}
227
238
}
0 commit comments