mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Partial URLs should not sanitize against SSRF
As an example:
```go
urlPath := ctx.Req.URL.Path
hash := urlPath[strings.LastIndex(urlPath, "/")+1:]
req, _ := http.NewRequest("GET", source+hash, nil)
```
This commit is contained in:
committed by
Owen Mansel-Chan
parent
15d5ad7a66
commit
8bf4b55309
@@ -35,4 +35,10 @@ module SafeUrlFlow {
|
||||
private class UnsafeUrlMethodEdge extends SanitizerEdge {
|
||||
UnsafeUrlMethodEdge() { this = any(UnsafeUrlMethod um).getACall().getReceiver() }
|
||||
}
|
||||
|
||||
/** Any slicing of the URL, considered as a sanitizer for safe URL flow. */
|
||||
private class StringSlicingEdge extends SanitizerEdge {
|
||||
StringSlicingEdge() { this = any(DataFlow::SliceNode sn) }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user