-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
x/vuln/cmd/govulncheck: doesn't report vulnerabilities for replaced modules #68254
Comments
Replacements with file paths don't have versions and could be anything, which means they can't be matched against a vulnerability database. |
perhaps the etcd repo would be better served by using a workspace rather than local replaces? |
@golang/vulndb Not sure there if there is a whole lot that can be done here given the way replace works, as others have pointed out. |
Govulncheck uses the replacement module as the source of truth. If your replacement is a local directory, then govulncheck really does not know what that replacement is and what its version is. We could use instead the module and version being replaced, but that could lead to incorrect results. I agree with the rest of the folks here, I am not sure if there is something we can do here. |
Thanks for your answers and suggestions. It makes sense to introduce a Go workspace in the project. I'm closing this issue, as I understand the limitation that |
govulncheck version
Go: go1.21.11
Scanner: [email protected]
DB: https://vuln.go.dev
DB updated: 2024-06-28 18:33:10 +0000 UTC
Does this issue reproduce at the latest version of golang.org/x/vuln?
Yes
Output of
go env
in your module/workspace:What did you do?
At etcd-io/etcd, we recently had a vulnerability reported (GHSA-5x4g-q5rc-36jp / golang/vulndb#2952). Our
govulncheck
job didn't catch this report, as we're using areplace
in ourgo.mod
; we were notified by other projects that had our project as a dependency.Running
govulncheck
at our repository yields no vulnerabilities:What did you see happen?
As stated, it didn't report the vulnerability. If we remove the
replace
statements fromgo.mod
(i.e.,go mod edit -json | jq .Replace[].Old.Path -r | xargs -n1 go mod edit -dropreplace && go mod tidy
):It does report the vulnerabilities.
I'm unsure if this is a limitation/expected behavior of
govulncheck
, or a bug. If it is a limitation ofgovulncheck
, we'll need to find a workaround to automate a job that can detect vulnerabilities reported invulndb
for our own source code.What did you expect to see?
The text was updated successfully, but these errors were encountered: