-
Notifications
You must be signed in to change notification settings - Fork 594
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
Go mod pseudo-versions may cause false positive results #972
Comments
Good find @FrimIdan! I can confirm your example. Digging in to this a bit, let me put the pseudo-versions documentation notes:
I think what we are looking at is a bit of a twofold:
It's possible some network requests such as following commit SHAs to the repositories and such could help. This would require handling this one specific case that we have a semver not prefixed with a We could potentially exclude pseudo-versions, but then we would be missing valid vulnerabilities, which isn't good, either. I'll note that we are currently looking at improving package identification in a number of areas that may include getting more information via the network, so this is something that might be able to be accounted for in the future. However, I would say the right thing to do here is bring this up with the istio team. If they didn't want to change the versioning altogether, I wonder if a possible solution would be to add TWO tags for each of the releases, one of which is prefixed with a |
@kzantow Thanks for the detailed answer. I've open istio/istio#41702 to check what is the reason not to use |
Thanks for following up with istio @FrimIdan! We are definitely interested in finding more ways to identify things, as noted earlier. I'll follow up here when we have a more concrete plan that might be able to address issues like this. |
Given the response from Istio about not expecting that repository to be used as a library, it looks like we probably won't be able to surface proper version information for a while. There is a fairly easy workaround to ignore matches in Grype. In your ignore:
- package:
name: istio |
Here are some specific repro steps (happening today with istio latest) Make a package like this: go mod init example.com/grype972
go get istio.io/istio Make a main.go like this: package main
import (
"fmt"
_ "istio.io/istio/pkg/fuzz"
)
func main() {
fmt.Println("Hello world")
} Then I think the issue may be because the isio github repo uses version tags that do not start with "v". |
What we're missing is the ability to know when the tags used to represent the version do not follow semver (in this case with a v prefix) so the version component will always be v0.0.0. I think in this circumstance we could try to add a golang version comparator that takes the special case of a v0.0.0 vs a non v0.0.0 is probably wrong. The problem is that this is not always true, so maybe this should be a configurable. Or lean towards Keiths suggestion of using the go proxy to detect this case (also opt in via config). |
This needs investigation - we want to compare the different approaches mentioned by @wagoodman at #972 (comment). We can discuss once there are some concrete examples to decide among. |
What happened:
Go program with pseudo versions in go.mod/sum cause false positive results
How to reproduce it (as minimally and precisely as possible):
Create a go program that points to
(go get istio.io/[email protected])
Scan it with grype.
You will get the following results
which are false positive since
v0.0.0-20220308185742-91533d04e894
is istio version 1.13.2Environment:
grype version
:The text was updated successfully, but these errors were encountered: