Skip to content

BUILD/MINOR: ci: add govulncheck, and fix the one vulnerability it reports - #844

Open
PixiBixi wants to merge 2 commits into
haproxytech:masterfrom
PixiBixi:build/govulncheck
Open

PixiBixi wants to merge 2 commits into
haproxytech:masterfrom
PixiBixi:build/govulncheck

Conversation

@PixiBixi

Copy link
Copy Markdown
Contributor

Adds a govulncheck job, together with the dependency bump that makes it pass, so the
job arrives green and has a demonstrated reason to exist.

The finding

govulncheck ./... on master today:

Vulnerability #1: GO-2026-5970
    Infinite loop on invalid input in golang.org/x/text
    Found in: golang.org/x/text@v0.38.0
    Fixed in: golang.org/x/text@v0.39.0
    Example traces found:
      #1: deploy/tests/e2e/client.go:133:22: e2e.Client.DoMethod calls http.Client.Do,
          which eventually calls norm.Form.Bytes
      #3: cmd/docs/annotations.go:158:78: docs.Conf.generateReadmeAnnotations calls
          cases.Caser.String, which eventually calls norm.Form.Properties

Both call sites are outside the controller: the e2e client and the documentation
generator. A running instance does not reach it, so this is not urgent, but it is exactly
the class of thing that is easier to keep at zero than to clean up later.

The first commit raises golang.org/x/text to v0.39.0. After it:

No vulnerabilities found.
Your code is affected by 0 vulnerabilities.

The 1 imported and 3 required vulnerabilities that the scan also mentions are not called
by the code, and govulncheck does not fail on those.

The job

19 lines, no configuration. golang/govulncheck-action reads the Go version from
go.mod, and govulncheck reports only what the code actually reaches, so it stays quiet
on a vulnerability sitting unused in a module. That is what keeps it from becoming the
job everyone learns to ignore.

The action is pinned by digest with the version in a comment, rather than by tag. That is
the form a bot keeps current, which is the subject of #842.

Checks

go build ./..., the unit suite, and make check-commit are clean with the bump applied.

Related: #843 restricts the token permissions of the workflows.

golang.org/x/text v0.38.0 carries GO-2026-5970, an infinite loop on invalid
input in the normalisation code, fixed in v0.39.0.

govulncheck reaches it from two places, both outside the controller: the
e2e client in deploy/tests/e2e/client.go, through http.Client.Do, and the
documentation generator in cmd/docs/annotations.go, through the cases
package. The controller itself does not call it, so the exposure is the
test suite and the doc target rather than a running instance.
Nothing in the pipeline looks at the known vulnerabilities of the
dependencies. govulncheck reports only the ones the code actually reaches,
so it stays quiet on a vulnerability that sits in a module without being
called, and it needs no configuration.

The job runs on a pull request and on a push to master. It passes on the
tree as of the previous commit, which raised golang.org/x/text to the
version that carries the fix for GO-2026-5970.

The action is pinned by digest rather than by tag, with the version in a
comment. This is the form a bot keeps current, see the Renovate issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant