-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
False positive in Go module on a dependency that is overridden with a safe version at compile time. #1559
Comments
I also verified the vulnerable version isn't included in the compiled binary... both the
Similarly running against the compiled version:
So why does Trivy continue to emit a warning about |
Hello @jeffwidman Regards, Dmitriy |
Ah, that's it! I had no idea So looks like the bug here is the cache wasn't properly cleared for dep bumps implemented via |
It's weird. The cache should not be used after the binary update. How did you scan it? |
This issue is stale because it has been labeled with inactivity. |
We hope it was fixed in v0.26.0. |
I compile/install
grpcurl
v1.8.5
into an image by having a dummymain.go
file:I tried running Trivy against the resulting image and got the following warning:
golang.org/x/text
is an indirect dependency. So I bumped the version number in thego.mod
file using the following pin:This will cause the compiled version to only include
v0.3.3
which fixes the CVE.Unfortunately, Trivy continues to give the same warning.
Some less sophisticated scanners will throw false positives like this because the
go.sum
file still lists the old vulnerable version, even though it's not actually used in the binary (due to the pin in thego.mod
file).So I next tried using a
replace
directive as this will completely remove the vulnerable version from thego.sum
file:Unfortunately the exact same warning continues to be thrown by Trivy.
I double-checked, and there's no mention of
golang.org/text/
v0.3.2
anywhere in thego.sum
file or thego.mod
file.grpcurl
deps and so as soon as it's pulled in you throw a warning even though we're completely overriding it in our source before it gets compiled?//indirect
pins ingo.mod
override?replace
directives ingo.mod
override?The text was updated successfully, but these errors were encountered: