-
Notifications
You must be signed in to change notification settings - Fork 18k
x/vuln: govulncheck should report vulnerabilities for all GOOS/GOARCH values #54841
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
Comments
What about a |
Based on an offline discussion, this should apply for the analysis of source code only. Users will likely apply govulncheck on binaries ready for deployment, so we can use os and system architecture info present in the binary.
Interesting idea, but I think we could add a line in the output for each vulnerability that also specifies to which os and archs the vuln applies to. This would avoid the need for the flag and would not complicate the output too much for the user.
Something like that. |
Change https://go.dev/cl/432356 mentions this issue: |
@zpavlinovic If I run |
It will discover vulns that affect only Windows. They will be reported with
so you can tell. Imagine that you develop on Mac but deploy to Linux servers. We don't know that, but we don't want you to miss a vulnerability. |
To clarify my question - will it be in the "Affecting vulnerability" section (for those with call info) or in the "Non-affecting vulnerability" section (for those without call info)? |
To answer my question - given that govulncheck still depends on |
With this change, govulncheck will create vulnerability graphs as if all of the vulnerabilities apply to all of the platforms. When we present the vulnerability info in the end, then we will simply mention which specific platforms this vulnerability applies to. I guess in theory it could happen that different underlying platforms can produce different compiled code, but I am not sure will that affect vulnerability detection in practice. I guess this mostly applies to the standard library? |
For example https://pkg.go.dev/vuln/GO-2022-0493 is a vulnerability in Hmm, I just realized this vulnerability won't be even reported in the informational section since |
This was the behavior before. This issue is about showing them that path regardless of what platform they are using: we show them that path and then mention that it would be exercised on the windows platform. We want to do this because users might run govulncheck on one platform during development where the vulnerability does not exist. That could give them a false sense of security if they also don't run govulncheck on other platforms for which some vulnerabilities do apply. Also, it is probably a better user experience doing things this way rather than the user running govulncheck on all possible platforms.
It should be based on the package imports graph. |
vulncheck.Source will return all matching vulns, regardless of the current values of GOOS and GOARCH. cmd/govulncheck displays the GOOS/GOARCH values if there are any. Fixes golang/go#54841. Change-Id: I98dbb75fe631416d0b53a8d4c851ee01a2d00c6c Reviewed-on: https://go-review.googlesource.com/c/vuln/+/432356 Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
vulncheck.Source will return all matching vulns, regardless of the current values of GOOS and GOARCH. cmd/govulncheck displays the GOOS/GOARCH values if there are any. Fixes golang/go#54841. Change-Id: I98dbb75fe631416d0b53a8d4c851ee01a2d00c6c Reviewed-on: https://go-review.googlesource.com/c/vuln/+/432356 Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
vulncheck.Source will return all matching vulns, regardless of the current values of GOOS and GOARCH. cmd/govulncheck displays the GOOS/GOARCH values if there are any. Fixes golang/go#54841. Change-Id: I98dbb75fe631416d0b53a8d4c851ee01a2d00c6c Reviewed-on: https://go-review.googlesource.com/c/vuln/+/432356 Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Running govulncheck on one platform shouldn't limit reports to vulnerabilities that apply to that platform. For example, running govulncheck on Linux should report Windows vulnerabilities as well.
We might want to have a flag that limits reports to just a subset of platforms, so users who don't care about Windows or WASM can get a more focused set of reports if they want.
The text was updated successfully, but these errors were encountered: