Skip to content

Commit 145f1a0

Browse files
cschoenduve-splunkCosmin Cojocar
authored andcommitted
Removed wrapping feature (#238)
1 parent 419c929 commit 145f1a0

File tree

2 files changed

+1
-44
lines changed

2 files changed

+1
-44
lines changed

rules/ssrf.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,6 @@ func (r *ssrf) Match(n ast.Node, c *gosec.Context) (*gosec.Issue, error) {
4040
return gosec.NewIssue(c, n, r.ID(), r.What, r.Severity, r.Confidence), nil
4141
}
4242
}
43-
// Look at the last selector identity for methods matching net/http's
44-
if node, ok := n.(*ast.CallExpr); ok {
45-
if selExpr, ok := node.Fun.(*ast.SelectorExpr); ok {
46-
// Pull last selector's identity name and compare to net/http methods
47-
if r.Contains("net/http", selExpr.Sel.Name) {
48-
if r.ResolveVar(node, c) {
49-
return gosec.NewIssue(c, n, r.ID(), r.What, r.Severity, r.Confidence), nil
50-
}
51-
}
52-
}
53-
}
5443
return nil, nil
5544
}
5645

testutils/source.go

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -228,39 +228,7 @@ func main() {
228228
fmt.Println(err)
229229
}
230230
fmt.Println(resp.Status)
231-
}`, 0}, {`
232-
package main
233-
234-
import (
235-
"net/http"
236-
"fmt"
237-
"os"
238-
"strconv"
239-
)
240-
241-
type httpWrapper struct {
242-
DesiredCode string
243-
}
244-
245-
func (c *httpWrapper) Get(url string) (*http.Response, error) {
246-
return http.Get(url)
247-
}
248-
249-
func main() {
250-
code := os.Getenv("STATUS_CODE")
251-
var url = os.Getenv("URL")
252-
client := httpWrapper{code}
253-
resp1, err1 := client.Get(url)
254-
if err1 != nil {
255-
fmt.Println(err1)
256-
os.Exit(1)
257-
}
258-
if strconv.Itoa(resp1.StatusCode) == client.DesiredCode {
259-
fmt.Println("True")
260-
} else {
261-
fmt.Println("False")
262-
}
263-
}`, 2}}
231+
}`, 0}}
264232
// SampleCodeG201 - SQL injection via format string
265233
SampleCodeG201 = []CodeSample{
266234
{`

0 commit comments

Comments
 (0)