@@ -19,37 +19,34 @@ func sink(interface{}) {
19
19
20
20
func fasthttpClient () {
21
21
userInput := "127.0.0.1:8909"
22
- userInputByte := []byte ("user Controlled input" )
23
22
fasthttp .DialDualStack (userInput ) // $ SsrfSink=userInput
24
23
fasthttp .Dial (userInput ) // $ SsrfSink=userInput
25
24
fasthttp .DialTimeout (userInput , 5 ) // $ SsrfSink=userInput
26
25
fasthttp .DialDualStackTimeout (userInput , 5 ) // $ SsrfSink=userInput
27
26
28
27
res := & fasthttp.Response {}
29
28
req := & fasthttp.Request {}
30
- req .SetHost (source ())
29
+ req .SetHost (source ().( string ) )
31
30
sink (req ) // $ hasTaintFlow="req"
32
- req .SetHostBytes (userInputByte )
31
+ req .SetHostBytes (source ().([] byte ) )
33
32
sink (req ) // $ hasTaintFlow="req"
34
- req .SetRequestURI (userInput )
33
+ req .SetRequestURI (source ().( string ) )
35
34
sink (req ) // $ hasTaintFlow="req"
36
- req .SetRequestURIBytes (userInputByte )
35
+ req .SetRequestURIBytes (source ().([] byte ) )
37
36
sink (req ) // $ hasTaintFlow="req"
38
37
39
38
uri := fasthttp .AcquireURI ()
40
39
userInput = "UserControlled.com:80"
41
- userInputByte = []byte ("UserControlled.com:80" )
42
- uri .SetHost (source ())
40
+ uri .SetHost (source ().(string ))
43
41
sink (uri ) // $ hasTaintFlow="uri"
44
- uri .SetHostBytes (source ())
42
+ uri .SetHostBytes (source ().([] byte ) )
45
43
sink (uri ) // $ hasTaintFlow="uri"
46
44
userInput = "http://UserControlled.com"
47
- userInputByte = []byte ("http://UserControlled.com" )
48
- uri .Update (source ())
45
+ uri .Update (source ().(string ))
49
46
sink (uri ) // $ hasTaintFlow="uri"
50
- uri .UpdateBytes (source ())
47
+ uri .UpdateBytes (source ().([] byte ) )
51
48
sink (uri ) // $ hasTaintFlow="uri"
52
- uri .Parse (source (), source ())
49
+ uri .Parse (source ().([] byte ) , source ().([] byte ))
53
50
sink (uri ) // $ hasTaintFlow="uri"
54
51
req .SetURI (uri )
55
52
0 commit comments