OCM-22871 | chore: update Go version to 1.25.8 in order to fix#3229
Conversation
|
/retest |
|
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:
|
|
/retest-required |
Keep ROSA on the Go 1.25.8 security fix line while moving the CI-only builder stream to OpenShift 4.22, since the 4.21 Go 1.25 stream still resolves to Go 1.25.7. This keeps the repo aligned to the verified fixed toolchain without moving onto the Go 1.26 line affected by the separate x509 CVE. Made-with: Cursor
WalkthroughThis PR upgrades the Go toolchain from 1.24.x to 1.25.8 across build configurations, updates golangci-lint to v2.11.4 and goreleaser to v2.15.1, introduces URL validation helpers to block malformed IPv6 literals, and migrates all URL parsing calls to use this new validation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amandahla, 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
Dockerfile (1)
1-2:⚠️ Potential issue | 🟠 MajorSet a non-root user in the final stage.
Line 2 hardens ownership in the builder, but the produced
ubi-microimage still defaults to root because the final stage never setsUSER. That keeps the DS-0002 finding alive and leaves the image with unnecessary privileges.Suggested fix
FROM registry.access.redhat.com/ubi9/ubi-micro:latest @@ -COPY --from=builder /opt/app-root/src/releases /releases +COPY --from=builder --chown=1001:0 /opt/app-root/src/releases /releases +USER 1001🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Dockerfile` around lines 1 - 2, The final image still runs as root because the Dockerfile only sets ownership in the builder stage; update the final stage to run as a non-root user (match the UID/GID used in builder, e.g., 1001:0) by creating or using that user and adding a USER directive in the final stage; ensure the runtime files/directories produced by the builder are owned by that UID/GID (or chowned during the final stage) so the non-root user can access them—look for the builder stage name ("builder") and add the USER instruction and any necessary ownership changes in the final stage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@images/Dockerfile.e2e`:
- Around line 10-12: The Dockerfile currently installs rosa-support with an
open-ended version ("github.com/openshift-online/rosa-support@latest"); change
RUN go install github.com/openshift-online/rosa-support@latest to pin a specific
released tag or commit (for example replace `@latest` with `@vX.Y.Z` or
@<commit-hash>) so the rosa-support binary is reproducible and won't break
builds when upstream changes; update the RUN line in the Dockerfile (the
rosa-support install step) to use the chosen fixed tag/commit and update any
accompanying build comments to record the pinned version.
---
Duplicate comments:
In `@Dockerfile`:
- Around line 1-2: The final image still runs as root because the Dockerfile
only sets ownership in the builder stage; update the final stage to run as a
non-root user (match the UID/GID used in builder, e.g., 1001:0) by creating or
using that user and adding a USER directive in the final stage; ensure the
runtime files/directories produced by the builder are owned by that UID/GID (or
chowned during the final stage) so the non-root user can access them—look for
the builder stage name ("builder") and add the USER instruction and any
necessary ownership changes in the final stage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 507007a9-c280-47ed-9bf9-43dacf2b89d3
⛔ Files ignored due to path filters (2)
.bingo/golangci-lint.sumis excluded by!**/*.sum.bingo/goreleaser.sumis excluded by!**/*.sum
📒 Files selected for processing (33)
.bingo/Variables.mk.bingo/bingo.mod.bingo/gci.mod.bingo/go-bindata.mod.bingo/golangci-lint.mod.bingo/goreleaser.mod.bingo/mockgen.mod.bingo/variables.env.golangci.yml.goreleaser.yamlCLAUDE.mdDockerfileMakefilecmd/create/idp/github.gocmd/create/idp/gitlab.gocmd/create/idp/ldap.gocmd/create/idp/openid.gocmd/create/operatorroles/by_prefix.gocmd/dlt/oidcprovider/cmd.gocmd/login/cmd.gogo.modimages/Dockerfile.e2eimages/Dockerfile.konfluxpkg/aws/idps.gopkg/aws/policy_document.gopkg/helper/url/helpers.gopkg/helper/url/helpers_test.gopkg/interactive/validation.gopkg/ocm/config.gopkg/ocm/config_test.gopkg/ocm/helpers.gopkg/ocm/helpers_test.gopkg/ocm/idps.go
💤 Files with no reviewable changes (1)
- .golangci.yml
| FROM registry.access.redhat.com/ubi9/go-toolset:1.25.8 AS rosa-support | ||
| WORKDIR /opt/app-root/src/rosa-support | ||
| RUN go install github.com/openshift-online/rosa-support@latest |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cd images && ls -la Dockerfile.e2e && wc -l Dockerfile.e2eRepository: openshift/rosa
Length of output: 139
🏁 Script executed:
head -30 images/Dockerfile.e2eRepository: openshift/rosa
Length of output: 1427
Pin rosa-support instead of building @latest.
Line 12 pulls whatever upstream publishes at build time, making this image non-reproducible. It can fail without a repo change if rosa-support changes behavior or raises its minimum Go version.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@images/Dockerfile.e2e` around lines 10 - 12, The Dockerfile currently
installs rosa-support with an open-ended version
("github.com/openshift-online/rosa-support@latest"); change RUN go install
github.com/openshift-online/rosa-support@latest to pin a specific released tag
or commit (for example replace `@latest` with `@vX.Y.Z` or @<commit-hash>) so the
rosa-support binary is reproducible and won't break builds when upstream
changes; update the RUN line in the Dockerfile (the rosa-support install step)
to use the chosen fixed tag/commit and update any accompanying build comments to
record the pinned version.
|
@olucasfreitas: all tests passed! 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.