Skip to content

[release-4.22] OCPBUGS-115003: Validate chart URL in /api/helm/verify to prevent SSRF - #17118

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:release-4.22from
fsgreco:cherry-pick-90080-4.22
Sep 1, 2026
Merged

[release-4.22] OCPBUGS-115003: Validate chart URL in /api/helm/verify to prevent SSRF#17118
openshift-merge-bot[bot] merged 1 commit into
openshift:release-4.22from
fsgreco:cherry-pick-90080-4.22

Conversation

@fsgreco

@fsgreco fsgreco commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

CONSOLE Features and Fixes

Manual backport of #16786 for OCPBUGS-115003 to release-4.22.

Solution description

/api/helm/verify previously passed an arbitrary chart_url to the backend verifier, allowing authenticated users to cause outbound requests to internal network addresses.

This backport validates the chart URL before verification. Only supported OCI URLs and HTTP(S) Helm chart archives (.tgz or .tar.gz) are accepted; invalid URLs are rejected with HTTP 400 before any outbound request is made.

Test cases

  • go test ./pkg/helm/handlers
  • go test ./pkg/helm/actions
  • Confirmed that internal URLs, non-archive HTTP URLs, empty URLs, and ftp:// / file:// URLs are rejected with HTTP 400.

Additional info

Original fix: #16786

The /api/helm/verify endpoint accepted arbitrary chart_url values without validation, allowing authenticated users to make the backend issue requests to internal network addresses. Reuse the existing IsValidChartURL check (already enforced on install and get-chart paths) to reject URLs that are not oci:// or http(s)://*.tgz before the backend attempts any connection.
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@fsgreco: This pull request references Jira Issue OCPBUGS-115003, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.
  • expected Jira Issue OCPBUGS-115003 to depend on a bug targeting a version in 5.0.0 and in one of the following states: MODIFIED, ON_QA, VERIFIED, but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

CONSOLE Features and Fixes

Manual backport of #16786 for OCPBUGS-115003 to release-4.22.

Solution description

/api/helm/verify previously passed an arbitrary chart_url to the backend verifier, allowing authenticated users to cause outbound requests to internal network addresses.

This backport validates the chart URL before verification. Only supported OCI URLs and HTTP(S) Helm chart archives (.tgz or .tar.gz) are accepted; invalid URLs are rejected with HTTP 400 before any outbound request is made.

Test cases

  • go test ./pkg/helm/handlers
  • go test ./pkg/helm/actions
  • Confirmed that internal URLs, non-archive HTTP URLs, empty URLs, and ftp:// / file:// URLs are rejected with HTTP 400.

Additional info

Original fix: #16786

Instructions 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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
openshift-ci Bot requested review from martinszuc and webbnh August 31, 2026 15:43
@openshift-ci openshift-ci Bot added the component/backend Related to backend label Aug 31, 2026

@webbnh webbnh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm
/cc @sowmya-sl

@openshift-ci
openshift-ci Bot requested a review from sowmya-sl August 31, 2026 19:58
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 31, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-console

@openshift-ci

openshift-ci Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fsgreco, webbnh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 31, 2026

@vikram-raj vikram-raj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/label backport-risk-assessed

@openshift-ci openshift-ci Bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Sep 1, 2026
@vikram-raj

Copy link
Copy Markdown
Member

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@vikram-raj: This pull request references Jira Issue OCPBUGS-115003, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

Instructions 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 openshift-eng/jira-lifecycle-plugin repository.

@vikram-raj

Copy link
Copy Markdown
Member

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 1, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@vikram-raj: This pull request references Jira Issue OCPBUGS-115003, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-90080 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-90080 targets the "5.0.0" version, which is one of the valid target versions: 5.0.0
  • bug has dependents
Details

In response to this:

/jira refresh

Instructions 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 openshift-eng/jira-lifecycle-plugin repository.

@fsgreco

fsgreco commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.21

@openshift-cherrypick-robot

Copy link
Copy Markdown

@fsgreco: once the present PR merges, I will cherry-pick it on top of release-4.21 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-4.21

Instructions 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.

@vikram-raj

Copy link
Copy Markdown
Member

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Sep 1, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@vikram-raj: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

Instructions 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 openshift-eng/jira-lifecycle-plugin repository.

@vikram-raj

Copy link
Copy Markdown
Member

/retest

@openshift-ci

openshift-ci Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@fsgreco: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions 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.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 82fd385 into openshift:release-4.22 Sep 1, 2026
8 checks passed
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@fsgreco: Jira Issue Verification Checks: Jira Issue OCPBUGS-115003
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-115003 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

CONSOLE Features and Fixes

Manual backport of #16786 for OCPBUGS-115003 to release-4.22.

Solution description

/api/helm/verify previously passed an arbitrary chart_url to the backend verifier, allowing authenticated users to cause outbound requests to internal network addresses.

This backport validates the chart URL before verification. Only supported OCI URLs and HTTP(S) Helm chart archives (.tgz or .tar.gz) are accepted; invalid URLs are rejected with HTTP 400 before any outbound request is made.

Test cases

  • go test ./pkg/helm/handlers
  • go test ./pkg/helm/actions
  • Confirmed that internal URLs, non-archive HTTP URLs, empty URLs, and ftp:// / file:// URLs are rejected with HTTP 400.

Additional info

Original fix: #16786

Instructions 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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-cherrypick-robot

Copy link
Copy Markdown

@fsgreco: #17118 failed to apply on top of branch "release-4.21":

Applying: OCPBUGS-115003: Validate chart URL in /api/helm/verify to prevent SSRF
Using index info to reconstruct a base tree...
M	pkg/helm/actions/get_chart.go
M	pkg/helm/actions/install_chart.go
M	pkg/helm/actions/install_chart_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/helm/actions/get_chart.go
CONFLICT (content): Merge conflict in pkg/helm/actions/get_chart.go
Auto-merging pkg/helm/actions/install_chart.go
CONFLICT (content): Merge conflict in pkg/helm/actions/install_chart.go
Auto-merging pkg/helm/actions/install_chart_test.go
CONFLICT (content): Merge conflict in pkg/helm/actions/install_chart_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 OCPBUGS-115003: Validate chart URL in /api/helm/verify to prevent SSRF

Details

In response to this:

/cherry-pick release-4.21

Instructions 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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. component/backend Related to backend jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants