Skip to content

Commit 7ea7796

Browse files
fix: clear govulncheck findings and drop x/crypto/openpgp (#546)
* fix: clear govulncheck findings and drop x/crypto/openpgp 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. * fix: upgrade zlib in the runtime image 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. * ci: retrigger scan after docker:29-cli rebuild * fix: harden updater version and platform validation --------- Co-authored-by: Daniel Polito <danielbpolito@gmail.com>
1 parent 602a036 commit 7ea7796

14 files changed

Lines changed: 528 additions & 106 deletions

File tree

‎.github/workflows/golangci-lint.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run golangci-lint
2121
uses: golangci/golangci-lint-action@v7
2222
with:
23-
version: v2.11.4
23+
version: v2.15.0

‎.github/workflows/govulncheck.yml‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
# 1.25.x tracks the same Go minor the Dockerfile builds with
15-
# (golang:1.25, pulled fresh), so CI and a local `kool run govulncheck`
14+
# 1.26.x tracks the same Go minor the Dockerfile builds with
15+
# (golang:1.26, pulled fresh), so CI and a local `kool run govulncheck`
1616
# do not disagree about which stdlib advisories still apply.
1717
- name: Install Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version: 1.25.x
20+
go-version: 1.26.x
2121

2222
- name: Checkout code
2323
uses: actions/checkout@v4
@@ -29,11 +29,9 @@ jobs:
2929
run: go install golang.org/x/vuln/cmd/govulncheck@latest
3030

3131
# Report-only on purpose. govulncheck has no suppression file (unlike
32-
# grype's .grype.yaml), and GO-2026-5932 -- x/crypto/openpgp is
33-
# unmaintained, reached through rhysd/go-github-selfupdate -- has no fix
34-
# available, so gating on it would pin the build red until that dependency
35-
# is replaced. Stdlib findings also churn with every Go patch release.
36-
# A genuine tool failure still fails the job.
32+
# grype's .grype.yaml), and stdlib findings churn with every Go patch
33+
# release, so gating on them would pin the build red until the next
34+
# toolchain bump. A genuine tool failure still fails the job.
3735
- name: Run govulncheck
3836
run: |
3937
set +e

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
test:
99
strategy:
1010
matrix:
11-
go-version: [1.25.x]
11+
go-version: [1.26.x]
1212
os: [ubuntu-latest, macos-latest]
1313
runs-on: ${{ matrix.os }}
1414
steps:

‎Dockerfile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.26.9 AS build
1+
FROM golang:1.26.11 AS build
22

33
ARG BUILD_VERSION=0.0.0-auto
44

@@ -18,6 +18,7 @@ ENV DOCKER_HOST=tcp://docker:2375
1818
COPY --from=build /app/kool /usr/local/bin/kool
1919

2020
RUN apk add --no-cache git bash \
21+
&& apk upgrade --no-cache zlib \
2122
&& rm -rf /var/cache/apk/* /tmp/*
2223

2324
CMD [ "kool" ]

‎build_artifacts.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if [ -f .env ]; then
2121
source .env
2222
fi
2323

24-
GO_IMAGE=${GO_IMAGE:-golang:1.25}
24+
GO_IMAGE=${GO_IMAGE:-golang:1.26}
2525

2626
if [ "$BUILD_VERSION" == "" ]; then
2727
echo "missing environment variable BUILD_VERSION"

‎commands/kool_task.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (t *DefaultKoolTask) Run(args []string) (err error) {
7373
statusMessage = color.New(color.Green).Sprint("done")
7474
}
7575

76-
t.actualOut.Printf("\r" + strings.Repeat(" ", t.termWidth-1) + "\r")
76+
t.actualOut.Printf("%s", "\r"+strings.Repeat(" ", t.termWidth-1)+"\r")
7777
t.actualOut.Println(fmt.Sprintf("[%s] %s", statusMessage, t.message))
7878

7979
return
@@ -131,7 +131,7 @@ func (t *DefaultKoolTask) printServiceOutput(lines chan string) <-chan bool {
131131

132132
for line := range lines {
133133
loading.Lock()
134-
t.actualOut.Printf("\r" + strings.Repeat(" ", t.termWidth-1) + "\r")
134+
t.actualOut.Printf("%s", "\r"+strings.Repeat(" ", t.termWidth-1)+"\r")
135135
if t.frameOutput {
136136
t.actualOut.Println(">", line)
137137
} else {

‎commands/kool_upgrade_available_checker.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (u *UpdateAwareService) Execute(args []string) (err error) {
3030
return
3131
}
3232

33-
ch := make(chan bool)
33+
ch := make(chan bool, 1)
3434

3535
go u.updater.CheckForUpdates(u.updater.GetCurrentVersion(), ch)
3636

‎core/shell/shell.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,12 @@ func Interactive(exe string, args ...string) (err error) {
349349

350350
// Println execs Println on writer
351351
func Println(out ...interface{}) {
352-
NewShell().Println(out)
352+
NewShell().Println(out...)
353353
}
354354

355355
// Printf execs Printf on writer
356356
func Printf(format string, a ...interface{}) {
357-
NewShell().Printf(format, a)
357+
NewShell().Printf(format, a...)
358358
}
359359

360360
// Error error output

‎go.mod‎

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module kool-dev/kool
22

3-
go 1.25.0
3+
go 1.26.0
4+
5+
toolchain go1.26.11
46

57
require (
68
github.com/AlecAivazis/survey/v2 v2.3.7
@@ -14,30 +16,28 @@ require (
1416
github.com/jedib0t/go-pretty/v6 v6.7.9
1517
github.com/leaanthony/debme v1.2.1
1618
github.com/moby/term v0.5.2
17-
github.com/onsi/gomega v1.7.0 // indirect
18-
github.com/rhysd/go-github-selfupdate v1.2.3
1919
github.com/spf13/afero v1.15.0
2020
github.com/spf13/cobra v1.10.2
21-
golang.org/x/oauth2 v0.36.0 // indirect
22-
golang.org/x/sys v0.45.0
23-
golang.org/x/term v0.43.0
24-
golang.org/x/text v0.39.0 // indirect
21+
golang.org/x/sys v0.50.0
22+
golang.org/x/term v0.48.0
23+
golang.org/x/text v0.44.0 // indirect
2524
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
2625
gopkg.in/yaml.v2 v2.4.0
2726
gopkg.in/yaml.v3 v3.0.1
2827
)
2928

30-
require github.com/compose-spec/compose-go v1.20.2
29+
require (
30+
github.com/compose-spec/compose-go v1.20.2
31+
github.com/google/go-github/v93 v93.0.0
32+
github.com/minio/selfupdate v0.6.0
33+
)
3134

3235
require (
36+
aead.dev/minisign v0.2.0 // indirect
3337
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
3438
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
35-
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
3639
github.com/fatih/color v1.19.0 // indirect
37-
github.com/google/go-cmp v0.7.0 // indirect
38-
github.com/google/go-github/v30 v30.1.0 // indirect
3940
github.com/google/go-querystring v1.2.0 // indirect
40-
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf // indirect
4141
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4242
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
4343
github.com/kr/text v0.2.0 // indirect
@@ -46,12 +46,8 @@ require (
4646
github.com/mattn/go-runewidth v0.0.23 // indirect
4747
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
4848
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
49-
github.com/russross/blackfriday/v2 v2.1.0 // indirect
5049
github.com/sirupsen/logrus v1.9.4 // indirect
5150
github.com/spf13/pflag v1.0.10 // indirect
52-
github.com/tcnksm/go-gitconfig v0.1.2 // indirect
53-
github.com/ulikunitz/xz v0.5.15 // indirect
5451
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
55-
go.yaml.in/yaml/v3 v3.0.4 // indirect
56-
golang.org/x/crypto v0.52.0 // indirect
52+
golang.org/x/crypto v0.59.0 // indirect
5753
)

0 commit comments

Comments
 (0)