grype icon indicating copy to clipboard operation
grype copied to clipboard

Table output removes duplicates despite vulnerability being in different projects

Open jneate opened this issue 1 year ago • 1 comments

Accidentally discovered running grype against a directory with two components in it, that have the same vulnerability results in Grype only displaying the one vulnerability in the table despite it appearing twice in two different files/locations.

image

Vuln ID: GHSA-36p3-wjmg-h94x

As you can see, in the JSON output the difference is the location but in the table output, the location is not present and therefore the removeDuplicates function https://github.com/anchore/grype/blob/main/grype/presenter/table/presenter.go#L83 removes it as a duplicate.

image

I think this could inadvertently be fixed by #1275 but thought best to raise it anyway.

jneate avatar May 31 '23 23:05 jneate

Thanks @jneate, we are discussing this. Would it make sense if we instead of removing the duplicate put a "(2)" indicator after the vulnerability ID, so that you could immediately see you have two instances of that vulnerability?

tgerla avatar Aug 17 '23 20:08 tgerla