Skip to content

govulncheck is blind to build-tool dependencies (buf, golangci-lint, mockery) #1402

Open

Description

@lklimek

Summary

The govulncheck CI job is marked as a gating check, but it never scans the Buf CLI, golangci-lint, or mockery dependency trees. A critical advisory in any of those would pass the gate silently.

Cause

Makefile:279 runs:

go run golang.org/x/vuln/cmd/[email protected] ./...

Developer tools are tracked in tools/tools.go, which is guarded by //go:build tools. Without that build tag, the tool imports are excluded from the package graph entirely, so ./... never resolves them.

Evidence

$ go list -deps -buildvcs=false ./...                   | grep -c bufbuild
0
$ go list -deps -buildvcs=false -tags tools ./tools/... | grep -c bufbuild
1

Zero bufbuild packages in the graph govulncheck actually scans.

Impact

Low direct risk — these are build-time tools, not linked into shipped binaries — but the gate currently implies coverage it does not provide. Buf in particular is guarded by exactly one control today (Dependabot freshness), which is not a vulnerability control: upstream bufbuild/buf has no SECURITY.md, no disclosure contact, and has never registered an advisory, so a clean database result carries little evidentiary weight.

Suggested fix

Add -tags tools to the govulncheck invocation in Makefile:279:

go run golang.org/x/vuln/cmd/[email protected] -tags tools ./...

Land this deliberately — it will likely surface findings in the golangci-lint and mockery graphs on first run, which need triaging (most will be unreachable build-time-only paths).

Context

Found while auditing #1397 (bufbuild/buf 1.71.0 → 1.72.0).

🤖 Reported by Claudius the Magnificent AI Agent

Activity

  1. lklimek commented on Sep 21, 2026

    @lklimek
    CollaboratorAuthor

    Confirmed on v1.8-dev (3eb3a23): make vulncheck excludes tool command roots; this is a low-priority CI coverage gap, not evidence of an exploitable dependency.
    The proposed -tags tools fix is insufficient: govulncheck v1.3.0 rejects blank-imported command packages (is a program, not an importable package), reproduced independently without external dependencies.
    Owner: Makefile/CI tool scanning. Scan actual tool binaries or command modules separately, reconcile tracked/executed versions, and coordinate module boundaries with #1404; full tools vulnerability audit remains outstanding.

    🤖 Co-authored by Claudius the Magnificent AI Agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions