Skip to content

fix(image): rebuild on Go 1.26.10 and patched Alpine packages - #7

Merged
blue4209211 merged 2 commits into
mainfrom
fix/cve-nvd8-rebuild
Oct 29, 2026
Merged

blue4209211 merged 2 commits into
mainfrom
fix/cve-nvd8-rebuild

Conversation

@mayankpande88

Copy link
Copy Markdown
Contributor

Summary

The published popeye image embeds a binary built with Go 1.23, which carries CVE-2025-68121 (CVSS 10.0) in the standard library, plus Alpine packages that already have fixes. This rebuilds it on Go 1.26.10 with current golang.org/x modules and patched Alpine packages. Popeye's output is unchanged.

How to verify

  1. After merge, push a v0.11.1-nudgebee.2 tag so release.yml publishes the image.
  2. trivy image ghcr.io/nudgebee/popeye:v0.11.1-nudgebee.2 reports no vulnerabilities (the current v0.11.1-nudgebee.1 reports a 10.0).
  3. popeye -A -o json --force-exit-zero against any cluster returns the same report as the previous image.

Type of change

  • Bug fix
  • CI / build
Test plan and detail
  • golang:1.26.10-alpine builder with GOTOOLCHAIN=local; golang.org/x/net v0.38.0 -> v0.62.0 (plus x/sys, x/term, x/text). k8s.io/* untouched.
  • Go 1.26 vets printf calls during go test, so three non-constant format strings are replaced; output is the same.
  • go build ./..., go vet ./..., go test ./... pass on Go 1.26.10.

Local e2e: ran the old and new images with the scanner's exact args (-A -o json --force-exit-zero) against a local kind cluster -> both exit 0; JSON has the same 410 key paths and the same content (score 90, grade A, 22 sections, 250 issue keys).

Trivy (vuln) on the rebuilt image: 0 findings at any severity. Old image: 1 NVD 8.0+ (stdlib 10.0), 10 counting vendor scores.

The published image embeds a binary built with Go 1.23 and old
golang.org/x modules, and ships Alpine packages with released fixes.
A Trivy scan reports CVE-2025-68121 (CVSS 10.0) in the Go standard
library plus openssl, musl and zlib findings.

- Build with golang:1.26.10-alpine and GOTOOLCHAIN=local so the
  embedded stdlib is the pinned one.
- Bump golang.org/x/net to v0.62.0 (and x/sys, x/term, x/text).
- Run apk upgrade in the runtime stage.
- go 1.26 vets printf calls during go test; replace three
  non-constant format strings so the test build passes.

Trivy (vuln scanner) on the rebuilt image reports zero findings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Go version to 1.26, upgrades several dependencies, and optimizes Dockerfile builds and package dependencies. It also refactors string formatting and error creation in internal/report and pkg/popeye.go. Feedback suggests avoiding unnecessary string allocations in internal/report/writer.go by passing arguments separately to fmt.Fprint, and adding nil checks in pkg/popeye.go to prevent potential nil-pointer dereferences when accessing output file flags.

Comment thread internal/report/writer.go Resolved
Comment thread pkg/popeye.go Resolved
@blue4209211
blue4209211 merged commit 70b8681 into main Oct 29, 2026
4 checks passed
@blue4209211
blue4209211 deleted the fix/cve-nvd8-rebuild branch October 29, 2026 09:24
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.

3 participants