Bump x/crypto, x/net and cel-go to clear trivy image findings - #834
Conversation
|
Reviewed this. The mechanics are sound: Two findings, both the same shape: the versions picked aren't the ones that actually clear the advisories. 1. cel-go v0.29.0 does not fix GHSA-gcjh-h69q-9w9g
The two vulnerability databases disagree, which is what makes this easy to miss:
The source says the Go DB is right. Trivy resolves Go module advisories against the GitHub database, so it reports this as fixed at v0.29.0 — which is why the post-bump scan came back clean. That clean result is a metadata error, not a fix. This is the one that matters most, because it's the one you correctly identify as plausibly reachable. As it stands the change clears two findings that were never reachable, leaves the one that might be, and makes the scanner report it as resolved. 2. x/crypto v0.55.0 was superseded a week before this PRTwo further
Same reachability story as CVE-2026-56854 — SuggestedThat gives cel-go v0.30.0, x/crypto v0.57.0, x/net v0.58.0, plus sync/sys/term/text forward. I ran it on this branch: One that won't go away either way: Nothing else to flag — the diff itself is clean and there's no source change to review. [Generated with claude code] |
Trivy reports three fixable vulnerabilities in all three images we publish, venafi-agent, disco-agent and discovery-agent: golang.org/x/crypto v0.52.0 CRITICAL CVE-2026-56854 fixed in 0.56.0 golang.org/x/net v0.55.0 HIGH CVE-2026-46600 fixed in 0.56.0 github.com/google/cel-go v0.28.1 MEDIUM GHSA-gcjh-h69q-9w9g fixed in 0.30.0 None of them appears to be reachable, which is why govulncheck reports zero. Only x/crypto/pbkdf2 is linked, not x/crypto/ssh, and the x/net packages we link are idna, httpguts, http2 and html, not dns/dnsmessage. cel-go/ext is linked, so the cel-go advisory is the one that is at least plausibly reachable, but govulncheck does not see the vulnerable symbols being called. Trivy works from the module versions recorded in the binary rather than from reachability, so it flags all three regardless. That is also what Artifact Hub and customer scanners do, so a released image would be reported as containing a CRITICAL whether or not it can be exploited. Better to bump before tagging than to explain afterwards. Two of the fixed versions are not the obvious ones: - cel-go needs v0.30.0, not the v0.29.0 the GitHub advisory names. ext/native.go is byte identical between v0.28.1 and v0.29.0; the isSkippedFieldName guard that fixes it first appears in v0.30.0, and the Go vulnerability database agrees (GO-2026-6094). Trivy resolves Go advisories against the GitHub database, so v0.29.0 makes the scanner report this as fixed when it is not. - x/crypto needs at least v0.56.0, which fixes two further ssh advisories published on 2026-09-02: CVE-2026-78662 (GO-2026-6354) and CVE-2026-56855 (GO-2026-6355). Going to x/crypto v0.57.0 pulls x/net to v0.58.0 by minimal version selection, past the 0.56.0 that fixes CVE-2026-46600, and brings sync, sys, term and text forward. All are indirect dependencies and there is no source change. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Richard Wall <richard.wall@cyberark.com>
b3a72ad to
e5ea0e8
Compare
|
Both findings confirmed and fixed. Force-pushed as e5ea0e8, now I verified each one independently rather than take it on trust, and you are right on both counts. cel-go. And the Go database backs it up: This is the one I am glad you caught. The clean trivy result on the previous push was a metadata artefact, and the effect would have been the worst of both worlds: the two findings that were never reachable get cleared, the one that plausibly is stays put, and the scanner starts reporting it as resolved. A green scan would have actively concealed it. x/crypto. Confirmed too: Same reachability story, and the same reason it does not matter: the argument for this PR was never exploitability, it was what the scanners report. Tagging at v0.55.0 would have put us back here inside a week. I went to v0.57.0 as you suggested rather than the minimum 0.56.0. Re-verified after the change: I have added a caveat to the description noting that the clean cel-go scan result is not itself evidence, for exactly the database reason above — the evidence is the source diff and On your two envtest failures, Noted on |
|
Thanks for the fix. Approved! |
Why now?
We are about to tag
v1.12.0-alpha.0. Trivy reports three fixable vulnerabilities, including a CRITICAL, in all three images we publish —venafi-agent,disco-agentanddiscovery-agent. This clears all three.golang.org/x/cryptosshauth bypassgolang.org/x/netdns/dnsmessageDoSgithub.com/google/cel-goFound by running the proposed
oci-security-scantarget from cert-manager/makefile-modules#688 against this repo.Two of the fixed versions are not the obvious ones
Both caught by @FelixPhipps in review; I verified each against the module source and the Go vulnerability database before changing anything.
cel-go needs v0.30.0, not the v0.29.0 the GitHub advisory names.
ext/native.gois byte-identical between v0.28.1 and v0.29.0. TheisSkippedFieldNameguard that actually fixes it first appears in v0.30.0:The databases disagree, and the Go one is right:
GHSA-gcjh-h69q-9w9gGO-2026-6094(same advisory)Trivy resolves Go advisories against the GitHub database. So the first version of this PR bumped to v0.29.0 and the scan came back clean — a metadata error, not a fix. Worse, it would have marked the one plausibly-reachable finding as resolved while leaving it in place.
x/crypto needs at least v0.56.0. Two further
x/crypto/sshadvisories were published on 2026-09-02, after v0.55.0: CVE-2026-78662 (GO-2026-6354) and CVE-2026-56855 (GO-2026-6355). Confirmed againstvuln.go.dev, both fixed in 0.56.0. Tagging at v0.55.0 would have meant fresh findings appearing within days.These are almost certainly not exploitable here
This explains why govulncheck reports zero while trivy reports three, and it should shape how urgently you treat it. I checked what is actually linked:
golang.org/x/crypto/pbkdf2is linked.golang.org/x/crypto/ssh, where every one of these advisories lives, is not in the binary at all.idna,httpguts,http2,http2/hpack,html.dns/dnsmessagefrom the module is not linked — the apparent hit is the Go standard library's own vendored copy.cel-go/ext, whereNativeTypeslives, is linked, via the Kubernetes apiserver CEL support. This is the one that is at least plausibly reachable, though govulncheck does not see the vulnerable symbols being called. It is also the one the v0.29.0 mistake would have papered over.So why bump at all? Trivy works from module versions recorded in the binary, not reachability. So do Artifact Hub and the scanners our customers run. A released image gets reported as carrying a CRITICAL regardless of exploitability, and that becomes a support conversation.
This is hygiene, not an incident. It should not be read as "we shipped an exploitable CRITICAL".
What changed
go get golang.org/x/crypto@v0.57.0 github.com/google/cel-go@v0.30.0 && go mod tidy, thenmake generate.Only
go.modandgo.sum.make generateproduced no further changes, soLICENSESis untouched — it records no versions, and no dependency was added or removed. All three are indirect dependencies and there is no source change to review.x/cryptov0.57.0 pullsx/netto v0.58.0 by MVS, past the 0.56.0 that fixes CVE-2026-46600, and bringssync,sys,termandtextforward.Testing
All three images clean, plus verify, 457 unit tests and govulncheck
Before, on master at 2463606,
make --keep-going oci-security-scanexits 2:After this change it exits 0, with all three images reporting no findings.
Note the cel-go part of that clean result is not by itself proof, for the database reason above — trivy would have called v0.29.0 clean too. The evidence for cel-go is the source diff and
GO-2026-6094, not the scanner.Also on this branch:
make verify— exit 0make test-unit— 457 tests, 0 failuresmake verify-govulncheck— 0 vulnerabilities (unchanged; it was already zero, which is the point above)--keep-goingmatters when reproducing. Without it, make stops at the first failing image and you see only one of three reports.