OCM-22871 | fix: update Go version to 1.25.8 in order to fix#3229
OCM-22871 | fix: update Go version to 1.25.8 in order to fix#3229olucasfreitas wants to merge 1 commit intoopenshift:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: olucasfreitas The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
.golangci.yml
Outdated
| version: "2" | ||
| run: | ||
| go: "1.24" | ||
| go: "1.26" |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
CLAUDE.md
Outdated
|
|
||
| ### Dependencies and Modules | ||
| - Go 1.24.0 minimum version | ||
| - Go 1.26.1 minimum version |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
/retest |
Dockerfile
Outdated
| USER root | ||
| COPY . . | ||
|
|
||
| ENV GOTOOLCHAIN=auto |
There was a problem hiding this comment.
When the base image’s Go is older than the version in go.mod, GOTOOLCHAIN=auto lets the Go command download and use the required toolchain. That implies internet access during docker build. For Konflux, do our build tasks allow that egress for the official Go toolchain download?
There was a problem hiding this comment.
I still think this is a risk since the pipeline can fail due lack of network (image Go version < go.mod) if a newer version is required or (image Go verion > go.mod) silently build with a newer version since go.mod sets the minimum.
Can we change the FROM to a pinned image version?
Similar:
https://github.com/openshift/cluster-ingress-operator/blob/master/Dockerfile
There was a problem hiding this comment.
Updated this direction in the latest push. The branch now targets Go 1.25.8 and pins the UBI builder images to registry.access.redhat.com/ubi9/go-toolset:1.25.8, so the container builds no longer rely on GOTOOLCHAIN=auto inside those Dockerfiles.
That also lines up better with the security tickets: upstream fixed CVE-2026-25679 in Go 1.25.8 and 1.26.1, while CVE-2026-27137 / OCM-22870 only affects Go 1.26, so staying on the latest 1.25.x line fixes the tracked net/url issue without taking on the separate Go 1.26-only vuln.
Dockerfile
Outdated
| @@ -1,6 +1,8 @@ | |||
| FROM registry.access.redhat.com/ubi9/go-toolset:latest AS builder | |||
| USER root | |||
There was a problem hiding this comment.
No longer required in the current branch. I removed USER root and switched the builder stage to COPY --chown=1001:0 . ., which still lets make release succeed. The builder image is now also pinned to registry.access.redhat.com/ubi9/go-toolset:1.25.8.
|
Follow-up update:
The remaining red Prow jobs are blocked on external CI config rather than the repo diff itself. The earlier Local verification after the follow-up commit:
|
| @@ -18,6 +18,7 @@ package url | |||
|
|
|||
| import ( | |||
| "fmt" | |||
| neturl "net/url" | |||
There was a problem hiding this comment.
no blocker: other packages use the file name helpers.go and helpers_test.go. Might be interesting follow same pattern.
There was a problem hiding this comment.
Aligned this in the latest push. The files are now pkg/helper/url/helpers.go and pkg/helper/url/helpers_test.go to match the helper naming pattern used elsewhere in the repo.
Made-with: Cursor
|
/retest-required |
|
@olucasfreitas: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
PR Summary
Remediate CVE-2026-25679 (incorrect parsing of IPv6 host literals in
net/url) by upgrading ROSA to Go 1.25.8 and hardening URL parsing.Detailed Description of the Issue
Go's
net/url.Parseinsufficiently validated the host/authority component and accepted some invalid URLs by treating garbage before an IPv6 literal as ignorable (for example,http://example.com[::1]:8080was accepted instead of rejected). This affectsParse,ParseRequestURI,JoinPath,URL.Parse, andURL.UnmarshalBinary.Upstream fixed this in Go 1.25.8 and Go 1.26.1. This PR now targets Go 1.25.8 specifically because it fixes the
net/urlissue tracked inOCM-22871while avoidingOCM-22870/CVE-2026-27137, which upstream states only affects Go 1.26.ROSA CLI uses
url.Parseandurl.ParseRequestURIextensively for validating user-supplied URLs (OIDC endpoints, proxy URLs, IDP issuer URLs, gateway URLs). An attacker could potentially craft a malformed IPv6 URL that bypasses validation.Related Issues and PRs
Type of Change
Previous Behavior
go.moddeclared a vulnerable Go version line for thenet/urlissue.net/url.Parse/ParseRequestURIdirectly without additional host validation.cmd/dlt/oidcprovider/cmd.gosilently ignored URL parse errors, risking nil pointer dereferences.go-toolset:latesttags withGOTOOLCHAIN=auto, which could make container builds depend on toolchain downloads.Behavior After This Change
net/urlfix forCVE-2026-25679.CVE-2026-27137.pkg/helper/url.Parse/ParseRequestURIwrappers that independently validate IPv6 host literal placement.cmd/dlt/oidcprovider/cmd.goare now reported and cause the command to exit.registry.access.redhat.com/ubi9/go-toolset:1.25.8, so container builds no longer depend onGOTOOLCHAIN=autoinside those Dockerfiles.How to Test (Step-by-Step)
make lintmake testmake rosagoreleaser-v2.15.1 check --config .goreleaser.yamlpodman run --rm registry.access.redhat.com/ubi9/go-toolset:1.25.8 go versionpodman build -f Dockerfile .podman build -f images/Dockerfile.konflux .Expected Results
All commands above exit 0.
images/Dockerfile.e2estill requires authenticated access toregistry.ci.openshift.orgfor a local build.Breaking Changes
Developer Verification Checklist
[JIRA-TICKET] | [TYPE]: <MESSAGE>.make testpasses.make lintpasses.make rosapasses.