Go: Partial URLs should not sanitize against SSRF#10026
Conversation
|
@pwntester Sorry this PR didn't get more attention. I've fixed up the formatting problem that was stopping CI from running properly (though it did take 3 attempts). Do you think this should be merged? Could you add a test, possibly based on the code you put in the PR description? Also, I find it confusing that the title says "should not sanitize" but the change adds a sanitizer. |
|
@owen-mc As I understand it, this is adding a sanitizer to In this case, @pwntester wants to mark flows coming from a part of the request URL as unsafe. So, for an incoming request like: The scheme, authority, and possibly path of the URL can't be arbitrarily set, so they are sources of @pwntester or anyone, please correct me if I'm wrong, since this is my first time looking at the Go SSRF query and libraries 😄. |
|
Thanks @atorralba (could not have explained it better with my own words 😄) |
As an example:
```go
urlPath := ctx.Req.URL.Path
hash := urlPath[strings.LastIndex(urlPath, "/")+1:]
req, _ := http.NewRequest("GET", source+hash, nil)
```
As an example: