Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client logs query parameters, which can leak secrets #206

Open
chazdnato opened this issue Oct 10, 2023 · 1 comment
Open

client logs query parameters, which can leak secrets #206

chazdnato opened this issue Oct 10, 2023 · 1 comment

Comments

@chazdnato
Copy link

There are several places where url.URL is used in a log or error, for example:

via logs:

v.Debug("performing request", "method", req.Method, "url", req.URL)

via returned error:

return nil, fmt.Errorf("%s %s giving up after %d attempt(s): %w",

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]
@thapabishwa
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants