-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: go get ignores go.mod from remote repo, can escalate into a security vuln #38196
Comments
Here's a way to escalate this bug into a security vulnerability: https://github.com/karalabe/go-issue-38196-keygen |
I believe this is go in gopath mode working as it always has been if you want to install in module mode related #30515 |
The issue you linked (#24250) was marked as a 1.12 release blocker, fixed by CL 148517, which was included in 1.12, and thus closed by the gopherbot when the commit was merged. This is the opposite of "ignored and locked". Did you link the wrong issue? |
Also as far as I know as of Go 1.13, the default is
Hmm, I did not see that part, only the last lines in the issue:
The last comments from that issue seem to be exactly this: installing a binary will not use the proper go modules. |
@sean-jc Hmm, scratch that, apparently
|
GO111MODULE continues to default to auto as of go1.14 |
Please can I humbly make a suggestion:
(last one quoted from the linked repro repository). There is no need to resort to such hyperbole, not least when you might not be in possession of all the facts. Instead, asking questions is more powerful way of conveying the same point:
|
@myitcv Fair points. It's just a bit frustrating when I see the following timelines:
It's fine to keep pushing a feature/fix if it doesn't make it into a release. It's just strange that something is important enough to be tagged a |
Understood, but I think the first step should be asking questions to confirm you have the correct understanding/interpretation; that costs nothing and builds rapport with people, rather than potentially putting people's backs up. Your frustration is shared by a number of people through #30515 and friends. This particular topic has been raised on the golang-tools calls many times. Unfortunately more pressing issues have pushed this down the priority list. |
@karalabe, issue #24250 was fixed in Go 1.12. But read the issue title carefully (emphasis mine):
You have to be in module mode for it to take effect. The way to activate module mode is to either invoke the You can use |
That is GOPATH mode working as it has always worked. It is only a security vulnerability to the extent that GOPATH mode is less secure than we would like it to be. If you want to ensure that your users install your binary in module mode, you can ask them to set At some point we should make another run at defaulting |
Technically you are right. Practically I'd argue a bit against it, because whilst it is exactly as secure as it was before, most people (myself included) don't know about this silent revertal to the old behavior in certain cases. Since the go.mod file is in the repo, I would have never considered that there's an easy way to go around it.
That is certainly doable, but my guess would be that most Go devs don't read the manual on how to install a binary, since Go made it so simple since forever. Maybe it's just me getting too used to it.
Feel free to close this issue. |
Closing. This will be resolved eventually when |
Happens with all Go versions ever supporting modules.
Repro: run outside of a Go module, I just want to install a Go binary:
What happens:
Why? Because Go flat out ignores the module file distributed in that repo; and upstream nuked their repository to pieces so there's no code there any more.
Doing it manually works:
This is apparently the same bug that was a
release blocker
in Go 1.12, and then just ignored and locked: #24250The text was updated successfully, but these errors were encountered: