-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/go: GOPROXY credentials exposed in case of errors #30610
Comments
Don't pass credentials in the Proper HTTPS basic auth support is coming in #26232. At that point you won't need to encode it in the URL, and logging the URL will not leak anything. So I'm closing this issue as a duplicate of #26232, and in the interim please find some other way to inject your credentials (maybe another layer of GOPROXY?). |
Passing credentials via As seen in gomods/athens#1046 this is an issue that others already have noticed. The fact that Athens supports basic auth will increase the risk that others go down this path since proper auth isn't in place yet. Even when proper auth is in place, will there be anything that prevents the user from still setting credentials in their (CC @FiloSottile who might have something to add since he asked me to open this issue when I asked about it) |
Ah, we can probably at least detect and reject credentials in the URL. |
FWIW Once Go Modules supports proper authentication such as sending headers to GOPROXY we will make Athens accept that mechanism and probably remove the basic auth option. That said, I also agree that Go should detect and reject credentials in the URL or at least detect and obfuscate them in logs. |
Change https://golang.org/cl/166179 mentions this issue: |
Change https://golang.org/cl/170879 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'm running a CI environment that uses
GOPROXY
to fetch dependencies, the proxy (athens) has basic auth enabled since it has access to private repos that all users shouldn't be able to access.The basic auth credentials are passed as a part of the GOPROXY, as
https://user:pass@myproxy
.If go get fails to fetch a dependency (read: if someone just injects a faulty dependency), go get will include username and password from the proxy in the logs readable by the user.
What did you expect to see?
The URL without credentials, or credentials masked (for all go commands that uses
GOPROXY
)What did you see instead?
Plain text username & password.
The text was updated successfully, but these errors were encountered: