Replies: 3 comments 5 replies
-
|
Hello @65278 Trivy uses the "debug/buildinfo" package to check information about Go binaries (you can use the
A Go binary doesn’t have any other way to determine its version. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @DmitriyLewen. I have very specifically mentioned that go pseudoversions are "regular", as in can be parsed by a regular grammar. As these cause false positives because trivy handles them incorrectly (I've linked the public docs), I'd like you to handle them properly. I can even provide a patch if so required. Regarding filters, these do not work for us, as we send packages to my government, which uses trivy to determine what CVEs they have. I can not tell my government to filter the CVEs they see in any way. At the moment, the only approach that I can use is binary patching the |
Beta Was this translation helpful? Give feedback.
-
|
We are seeing the same problem with Github CLI
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Golang has a concept of pseudo versions, which do not actually refer to versions, but to git commits:
https://go.dev/ref/mod#pseudo-versions
These are regularly formatted as
vX.Y.Z-$date-$commit-$info, where X Y Z can be 0 or also semantically correct golang versions (often times it's impossible to properly refer to project versions in go.mod because golang api version differs from project version, i.e. teleport).As an example, grafana alleviated CVE-2025-47907 by releasing a rebuild with golang 1.24.6.
This release has an internal version
github.com/grafana/grafana │ CVE-2018-15727 │ CRITICAL │ fixed │ v0.0.1-test.0.20250723164904-3b49fbaa5c2c+dirtyThis triggers trivy because v0.0.1 < v12.0.4.
This is in Q&A, but this is clearly a bug. Trivy is supposed to parse the golang binary section for versions correctly, and it doesn't. Also, the discussion had no actionable points.
Ref: #6534
Desired Behavior
Trivy ignores golang pseudo-versions because they only introduce false positives and regularly happen in production code because of the reasons stated above.
If so desired, trivy could be extended to recursively link commits to repositories and tags (repositories provided by users).
Actual Behavior
Trivy lists all CVEs since pseudo-version, even if pseudo-version refers to a CVE-free commit.
Reproduction Steps
Target
None
Scanner
Vulnerability
Output Format
None
Mode
Standalone
Debug Output
Operating System
Jamtoe Ganoo Lunix, doesn't matter
Version
felix@lb03035 ~/ionos $ trivy --version Version: v0.65.0 Vulnerability DB: Version: 2 UpdatedAt: 2025-09-05 06:30:47.074373351 +0000 UTC NextUpdate: 2025-09-06 06:30:47.07437308 +0000 UTC DownloadedAt: 2025-09-05 08:28:43.425584925 +0000 UTCChecklist
trivy clean --allBeta Was this translation helpful? Give feedback.
All reactions