hashicorp / hashicorp/go-retryablehttp
client logs query parameters, which can leak secrets
- Dominant language
- Go
- Stars
- 2.3k
- Forks
- 298
- PR merge metrics
- No merged PRs in 30d
Description
There are several places where `url.URL` is used in a log or error, for example:
via logs:
https://github.com/hashicorp/go-retryablehttp/blob/571a88bc9c3b7c64575f0e9b0f646af1510f2c76/client.go#L597
via returned error:
https://github.com/hashicorp/go-retryablehttp/blob/571a88bc9c3b7c64575f0e9b0f646af1510f2c76/client.go#L751
While the former can be mitigated by setting a `nil` logger on client instantiation, users of the client have to deal with potential query param / data leaks through errors.
We would like to see either a removal of query params entirely, or an option to disable full query param reporting. We could replace instances of `url.URL` with a few options:
```
# Option 1, build URL w/o query params
cleanURL := url.Scheme + "://" + url.Host + url.Path
# Option 2, truncate query params
cleanURL := strings.Split(url.URL, "?")[0]
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.