[release-4.22] OCPBUGS-115003: Validate chart URL in /api/helm/verify to prevent SSRF - #17118
Conversation
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.
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@fsgreco: This pull request references Jira Issue OCPBUGS-115003, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
Scheduling tests matching the |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
vikram-raj
left a comment
There was a problem hiding this comment.
/label backport-risk-assessed
|
/jira refresh |
|
@vikram-raj: This pull request references Jira Issue OCPBUGS-115003, which is invalid:
Comment DetailsIn response to this:
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. |
|
/jira refresh |
|
@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
DetailsIn response to this:
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. |
|
/cherry-pick release-4.21 |
|
@fsgreco: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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. |
|
/verified by CI |
|
@vikram-raj: This PR has been marked as verified by DetailsIn response to this:
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. |
|
/retest |
|
@fsgreco: 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. |
82fd385
into
openshift:release-4.22
|
@fsgreco: Jira Issue Verification Checks: Jira Issue OCPBUGS-115003 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. 🕓 DetailsIn response to this:
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: #17118 failed to apply on top of branch "release-4.21": DetailsIn response to this:
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. |
CONSOLE Features and Fixes
Manual backport of #16786 for OCPBUGS-115003 to
release-4.22.Solution description
/api/helm/verifypreviously passed an arbitrarychart_urlto 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 (
.tgzor.tar.gz) are accepted; invalid URLs are rejected with HTTP 400 before any outbound request is made.Test cases
go test ./pkg/helm/handlersgo test ./pkg/helm/actionsftp:///file://URLs are rejected with HTTP 400.Additional info
Original fix: #16786