Skip to content

fix: clear govulncheck findings and drop x/crypto/openpgp - #546

Merged
dbpolito merged 4 commits into
kool-dev:mainfrom
FelipeEstevanatto:fix/govulncheck-clean
Nov 13, 2026
Merged

dbpolito merged 4 commits into
kool-dev:mainfrom
FelipeEstevanatto:fix/govulncheck-clean

Conversation

@FelipeEstevanatto

Copy link
Copy Markdown
Contributor
Issue N/A — found by the report-only govulncheck CI job
🪲 Bug Fix Yes
🧰 Improvement Yes
🏆 Feature No
📝 Refactor Yes
❌ Removed No
📖 Documentation No
⚠️ Break Change No

Description
govulncheck reported 12 reachable vulnerabilities: 11 Go stdlib advisories and GO-2026-5932 (x/crypto/openpgp, reached through rhysd/go-github-selfupdate → google/go-github/v30).

The openpgp finding cannot be fixed by bumping x/crypto: openpgp was removed in x/crypto v0.59.0, so go-github/v30 — and therefore the current self-update library — no longer compiles against a fixed version. This replaces the self-update implementation instead of upgrading it.

  • Replaces rhysd/go-github-selfupdate with a GitHub-only updater built on google/go-github/v93 and minio/selfupdate.
  • Keeps the existing per-asset .sha256 validation.
  • Matches kool's exact kool-<os>-<arch> release assets, which also fixes 32-bit ARM self-update (kool-linux-arm6 / arm7 were never matched before).
  • Drops openpgp, oauth2, xz and go-github/v30 from the module graph, and avoids the Gitea/GitLab SDKs that the creativeprojects/go-selfupdate alternative pulls in. x/crypto remains only as an indirect dependency at v0.59.0 (without openpgp). The module graph goes from 92 to 79 modules and the release binary grows by ~0.65 MB (+3.7%), versus ~+9 MB for the alternative.
  • Aligns the Go toolchain to 1.26.11 (Dockerfile, CI, local helpers and go.mod), clearing the stdlib advisories fixed in Go 1.26.9–1.26.11.
  • Addresses the stricter go vet checks enabled by the Go 1.26 language version (constant format strings and variadic forwarding).
  • Bumps golangci-lint to v2.15.0 for Go 1.26 support.

govulncheck now reports zero vulnerabilities.


Notes
Validation:

  • gofmt -l ., go vet ./..., go build ./...
  • go test -race ./... — all packages, including new updater unit tests
  • golangci-lint run ./... — 0 issues
  • govulncheck ./... — No vulnerabilities found
  • Docker image build (golang:1.26.11) and kool --version
  • Cross-compilation: linux amd64/arm64/arm6 and darwin amd64/arm64
  • Live release discovery against the latest GitHub release (3.8.1): asset selected and SHA-256 verified

Behavior notes:

  • kool self-update keeps the same UX, asset naming convention and .sha256 validation. No public commands, flags or output formats change.
  • Fixing vararg forwarding in core/shell (Println/Printf) also corrects output when multiple arguments are passed; existing tests pass.
  • go.mod now declares toolchain go1.26.11, so local builds with an older toolchain auto-download it (GOTOOLCHAIN=auto).
  • The govulncheck workflow stays report-only; it can be made gating in a follow-up now that the baseline is clean.

Replace rhysd/go-github-selfupdate with a GitHub-only implementation
built on google/go-github/v93 and minio/selfupdate. The old library
pulled google/go-github/v30, whose github package imports the
unmaintained x/crypto/openpgp package (GO-2026-5932). Since x/crypto
removed openpgp in v0.59.0, the dependency had to be replaced rather
than upgraded.

The new implementation keeps per-asset .sha256 validation, matches
kool's exact kool-<os>-<arch> asset names (fixing arm6/arm7 asset
selection) and avoids pulling the Gitea/GitLab SDKs. It also removes
x/crypto, oauth2 and the archive dependencies from the module graph,
and the release binary only grows by about 0.7 MB.

Align the Go toolchain with 1.26.11 so the stdlib advisories fixed in
1.26.9-1.26.11 are cleared, address the stricter go vet checks that
come with the go 1.26 language version, and bump golangci-lint to
v2.15.0 for Go 1.26 support.

After this change govulncheck reports no vulnerabilities.
@github-actions github-actions Bot added release-drafter:changed Release drafter: Changed release-drafter:fixed Release drafter: Fixed release-drafter:minor Release drafter: Minor release-drafter:patch Release drafter: Patch labels Nov 13, 2026
FelipeEstevanatto and others added 3 commits November 12, 2026 22:13
Alpine 3.24 in docker:29-cli still ships zlib 1.3.2-r1, which grype
flags as CVE-2026-4738 (critical). The Alpine v3.24 repository already
provides 1.4-r0, so upgrade just that package when building the runtime
image instead of waiting for a base image rebuild.

Verified with grype v0.97.1: the image no longer reports the zlib
finding. The remaining x/net critical comes from the docker-buildx
plugin bundled in docker:29-cli, not from kool.
@dbpolito

Copy link
Copy Markdown
Member

Reviewed the dependency/toolchain upgrade and replacement updater. Fixed the blockers in 8675725: validate the release version before downloading/installing, skip equal/older releases, select only compatible ARM assets from build metadata, bound HTTP requests, and surface rollback failures. Added update-path regression tests using temporary executable targets, including checksum failures, missing assets, HTTP failures, cancellation, and unchanged binaries on failures/no-ops.

Validation passed with Go 1.26.11: go test -race ./..., go vet ./..., govulncheck (no vulnerabilities), and repository lint (golangci-lint 2.15.0). Cross-built all six supported release targets. Docker build and version smoke test passed. Isolated live CLI tests passed for 3.8.0 → 3.8.1, equal/newer versions remaining unchanged, and self-update through a symlink. No published release or installed user binary was modified.

Waiting for CI on the pushed revision before merge. The separate Node LTS issue #545 is not addressed by this PR.

@dbpolito
dbpolito merged commit 7ea7796 into kool-dev:main Nov 13, 2026
9 checks passed
@dbpolito

Copy link
Copy Markdown
Member

Published in 3.9.0, with all six binaries and verified SHA-256 files attached. Release-guide checks passed; isolated live upgrade from the old 3.8.1 updater to 3.9.0 passed and matched the release artifact, and the new updater correctly left an equal-version binary unchanged.

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

Labels

release-drafter:changed Release drafter: Changed release-drafter:fixed Release drafter: Fixed release-drafter:minor Release drafter: Minor release-drafter:patch Release drafter: Patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants