You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because the returned GoVersion includes the additional experiment tags as part of the "version".
Desired Behavior
Trivy successfully extracts the Go version and reports the vulnerabilities
Actual Behavior
Trivy fails to extract the Go version and as such does not detect/report Go stdlib vulnerabilities
Reproduction Steps
Build the following Dockerfile (docker build -t goexperiment-test .):
FROM golang:1.22.1 AS builder
COPY <<EOF /example.go
package main
func main() {
println("Hello World")
}
EOF
RUN GOEXPERIMENT=loopvar go build -o /example /example.go
FROM scratch
COPY --from=builder /example /example
Scan the image using trivy, observe that no stdlib vulnerabilities are reported and an error is found in the output:
Discussed in #6695
Originally posted by lyoung-confluent May 16, 2024
Description
When running trivy on a Golang binary that was compiled with GOEXPERIMENT such as
boringcrypto
orloopvar
the version extraction forstdlib
will fail:This is because the returned
GoVersion
includes the additional experiment tags as part of the "version".Desired Behavior
Trivy successfully extracts the Go version and reports the vulnerabilities
Actual Behavior
Trivy fails to extract the Go version and as such does not detect/report Go
stdlib
vulnerabilitiesReproduction Steps
Dockerfile
(docker build -t goexperiment-test .
):trivy
, observe that nostdlib
vulnerabilities are reported and an error is found in the output:Target
Container Image
Scanner
Vulnerability
Output Format
None
Mode
None
Debug Output
The text was updated successfully, but these errors were encountered: