🐹 Go Fan Report: golang.org/x/vuln
Module Overview
golang.org/x/vuln ships govulncheck, Go's official vulnerability scanner. Its superpower is reachability analysis: it does symbol-level call-graph tracing so it only flags vulnerabilities your code can actually reach — far fewer false positives than version-only matching. In gh-aw it's a build-time tool, not an imported library.
Current Usage in gh-aw
- Files: 1 source file references it —
tools.go (blank import under //go:build tools).
- Import Count: 1 (
_ "golang.org/x/vuln/cmd/govulncheck").
- Invocations:
Makefile (security-govulncheck, tools targets) and .github/workflows/security-scan.yml (dedicated govulncheck job → SARIF → code scanning).
- Key APIs Used: none — CLI only. Runs the default source / symbol-level scan over
./..., which is the recommended low-false-positive mode. 👍
Research Findings
- Latest tag:
v1.4.0, published 2026-06-17 — go.mod currently pins v1.3.0.
- ⚠️ GitHub Releases are misleading: the last Release is
v1.1.4 (Jan 2025). v1.2.0, v1.3.0, v1.4.0 ship as git tags only. Trust go list -m -versions golang.org/x/vuln, not the Releases page.
Recent Updates (v1.3.0 → v1.4.0)
cmd/govulncheck: fix exit code propagation for wrapped scan errors — CI-relevant: a wrapped scan error could previously mask a non-zero exit, weakening the gate.
- Routine
golang.org/x dependency bumps.
Best Practices
- Keep the default source/symbol scan — don't switch to
-scan=module (inflates false positives).
- Emitting SARIF to code scanning (as CI does) is the recommended pattern. 👍
Improvement Opportunities
🏃 Quick Wins
- Collapse three conflicting version pins into one. Today govulncheck is pinned three different ways:
go.mod / tools.go: v1.3.0
Makefile tools target: v1.1.4 (≈18 months / two minor versions stale)
Makefile security-govulncheck: @latest (non-reproducible — local scans can diverge from CI)
- Bump go.mod to
v1.4.0 to pick up the exit-code fix, then derive everything from it.
✨ Feature Opportunities
- Run via the pinned toolchain, not
go install. Replace go install ...@latest`` / ...@v1`.1.4` with `go run golang.org/x/vuln/cmd/govulncheck ./...` — uses the exact go.mod version, zero drift, no separate install step.
- Adopt the Go 1.24+
tool directive (project is on go 1.26.3). go get -tool golang.org/x/vuln/cmd/govulncheck + go tool govulncheck ./... replaces the legacy //go:build tools + tools.go pattern, keeps the pin in go.mod, and gives Makefile and CI one invocation path.
📐 Best Practice Alignment
- Converge the CI
golang/govulncheck-action@v1.0.4 (bundles its own govulncheck) and the Makefile path onto a single pinned version so local and CI results match.
🔧 General Improvements
- The same drift pattern affects sibling tools (e.g.
actionlint pinned v1.7.11 in Makefile vs v1.7.12 in go.mod). Sourcing tool versions from go.mod via go run/go tool fixes the whole class at once.
Recommendations (prioritized)
- Bump
golang.org/x/vuln → v1.4.0 in go.mod (exit-code propagation fix).
- Switch Makefile
security-govulncheck + tools to go run golang.org/x/vuln/cmd/govulncheck ./... (kills the @latest and v1.1.4 drift).
- (Optional, larger) Migrate
tools.go → go.mod tool directive and use go tool everywhere.
Next Steps
Generated by Go Fan
Module summary saved to: scratchpad/mods/golang-x-vuln.md
Generated by 🐹 Go Fan · ◷
🐹 Go Fan Report: golang.org/x/vuln
Module Overview
golang.org/x/vulnships govulncheck, Go's official vulnerability scanner. Its superpower is reachability analysis: it does symbol-level call-graph tracing so it only flags vulnerabilities your code can actually reach — far fewer false positives than version-only matching. In gh-aw it's a build-time tool, not an imported library.Current Usage in gh-aw
tools.go(blank import under//go:build tools)._ "golang.org/x/vuln/cmd/govulncheck").Makefile(security-govulncheck,toolstargets) and.github/workflows/security-scan.yml(dedicatedgovulncheckjob → SARIF → code scanning)../..., which is the recommended low-false-positive mode. 👍Research Findings
v1.4.0, published 2026-06-17 — go.mod currently pinsv1.3.0.v1.1.4(Jan 2025).v1.2.0,v1.3.0,v1.4.0ship as git tags only. Trustgo list -m -versions golang.org/x/vuln, not the Releases page.Recent Updates (v1.3.0 → v1.4.0)
cmd/govulncheck: fix exit code propagation for wrapped scan errors— CI-relevant: a wrapped scan error could previously mask a non-zero exit, weakening the gate.golang.org/xdependency bumps.Best Practices
-scan=module(inflates false positives).Improvement Opportunities
🏃 Quick Wins
go.mod/tools.go: v1.3.0Makefiletoolstarget: v1.1.4 (≈18 months / two minor versions stale)Makefilesecurity-govulncheck:@latest(non-reproducible — local scans can diverge from CI)v1.4.0to pick up the exit-code fix, then derive everything from it.✨ Feature Opportunities
go install. Replacego install ...@latest`` /...@v1`.1.4` with `go run golang.org/x/vuln/cmd/govulncheck ./...` — uses the exact go.mod version, zero drift, no separate install step.tooldirective (project is ongo 1.26.3).go get -tool golang.org/x/vuln/cmd/govulncheck+go tool govulncheck ./...replaces the legacy//go:build tools+tools.gopattern, keeps the pin in go.mod, and gives Makefile and CI one invocation path.📐 Best Practice Alignment
golang/govulncheck-action@v1.0.4(bundles its own govulncheck) and the Makefile path onto a single pinned version so local and CI results match.🔧 General Improvements
actionlintpinnedv1.7.11in Makefile vsv1.7.12in go.mod). Sourcing tool versions from go.mod viago run/go toolfixes the whole class at once.Recommendations (prioritized)
golang.org/x/vuln→v1.4.0in go.mod (exit-code propagation fix).security-govulncheck+toolstogo run golang.org/x/vuln/cmd/govulncheck ./...(kills the@latestandv1.1.4drift).tools.go→ go.modtooldirective and usego tooleverywhere.Next Steps
tool-directive migration as a separate cleanup covering all four tools.Generated by Go Fan
Module summary saved to: scratchpad/mods/golang-x-vuln.md