Skip to content

fix(build): pin Go 1.27.3 to clear 4 stdlib CVEs; bump brotli - #251

Merged
tibroc merged 3 commits into
mainfrom
fix/go-stdlib-cves-brotli
Oct 27, 2026
Merged

tibroc merged 3 commits into
mainfrom
fix/go-stdlib-cves-brotli

Conversation

@tibroc

@tibroc tibroc commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Clears code scanning alerts #1–#4 and bumps andybalholm/brotli.

Why

The published image carried Go 1.27.1 because the Dockerfile tracked the floating golang:1.27 tag. Trivy flags four HIGH stdlib CVEs in the server binary, all fixed in 1.27.3:

Alert CVE Area
#4 CVE-2026-111943 crypto/x509 — untrusted intermediates (OIDC back-channel relies on this)
#3 CVE-2026-97031 crypto/tls — ECH DoS
#2 CVE-2026-78669 HTTP/2 SETTINGS DoS
#1 CVE-2026-78667 net/http Range DoS

Changes

  • Dockerfile golang:1.27 → golang:1.27.3. Pinning the patch also gives the docker Dependabot ecosystem something to bump; with the floating tag it never proposed anything.
  • CI go-version: "1.26" → read from the Dockerfile's golang:<v> AS build line (fails loudly if unparsable). Dependabot moved the image to 1.27 in chore(deps): Bump library/golang from 1.26 to 1.27 #106 but CI kept testing 1.26, so we shipped a toolchain CI never ran; with one pin, the docker Dependabot bump now moves CI too.
  • golangci-lint v2.12.2 → v2.15.0 — required by the above: the old pin can't read Go 1.27 export data (export data version 5 is greater than maximum supported version 4). 0 issues on the new version.
  • brotli v1.2.3 → v1.2.7 (separate commit). Hygiene only: brotli is reached solely via go tool goose → ClickHouse driver and is in no shipped binary; GitHub's advisory DB lists nothing against it.

Side effect on shipped binaries (module graph is shared with tools): x/sync 0.23→0.24 (also in #249), x/sys 0.47→0.49, x/text 0.41→0.43. Nothing else in go list -deps ./cmd/... changes.

Verified locally on go1.27.3

  • go build, go vet, make lint (0 issues), make test (race, with Postgres + mock IdP) green
  • govulncheck ./...: no vulnerabilities
  • make build → bin/server: go1.27.3; internal/web/dist stays clean
  • The image itself is built and Trivy-scanned by this PR's CI job (no local image build).

After merge: the main push publishes the image; then re-run the Security scan workflow so alerts #1–#4 auto-close.

brotli reaches the module graph only through the goose CLI (go tool
goose -> ClickHouse driver); it is not in any shipped binary. No
advisory is published against v1.2.3 — this is a hygiene bump to the
latest release.
The published image carried Go 1.27.1 because the Dockerfile tracked
the floating golang:1.27 tag. Trivy flags four HIGH stdlib CVEs in the
server binary (code scanning alerts #1-#4): CVE-2026-111943 (x509
untrusted intermediates), CVE-2026-97031 (TLS ECH DoS),
CVE-2026-78669 (HTTP/2 SETTINGS DoS), CVE-2026-78667 (Range DoS).
All are fixed in 1.27.3.

- Dockerfile: golang:1.27 -> golang:1.27.3. A pinned patch tag also
  lets the docker Dependabot ecosystem propose future patch bumps;
  with the floating tag it never had anything to update.
- CI: go-version 1.26 -> 1.27.3. Dependabot moved the image to 1.27
  in #106 but CI kept testing on 1.26, so we shipped a toolchain CI
  never ran.
- golangci-lint v2.12.2 -> v2.15.0. The old pin cannot read Go 1.27
  export data ("export data version 5 is greater than maximum
  supported version 4"), which is what moving CI to 1.27 would
  otherwise break. 0 issues under the new version.

The tool bump shares the module graph, so shipped binaries move
x/sync 0.23->0.24, x/sys 0.47->0.49 and x/text 0.41->0.43; nothing
else in their build list changes.
Review of this PR: with go-version pinned in ci.yml and the image tag
pinned in the Dockerfile, Dependabot's docker ecosystem would bump the
image and leave CI behind — the same split #106 caused. CI now takes
the version from the Dockerfile's `golang:<v> AS build` line and fails
loudly if that line can't be parsed, so the image tag is the one pin.
@tibroc
tibroc merged commit 860cd52 into main Oct 27, 2026
7 checks passed
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