Skip to content

fix(security): prevent SSRF by validating URL schemes in file content… - #1048

Open
vinokurig wants to merge 1 commit into
mainfrom
CRW-11956
Open

fix(security): prevent SSRF by validating URL schemes in file content…#1048
vinokurig wants to merge 1 commit into
mainfrom
CRW-11956

Conversation

@vinokurig

Copy link
Copy Markdown
Contributor

… providers

What does this PR do?

Restrict URL fetching to http/https schemes only, rejecting file://, ftp://, jar:, and other schemes that could be exploited to read local files or access cloud metadata endpoints. Also fix incorrect null-check in ScmService that validated repository twice instead of filePath.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://redhat.atlassian.net/browse/CRW-11956

How to test this PR?

N/A

PR Checklist

As the author of this Pull Request I made sure that:

Release Notes

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@openshift-ci

openshift-ci Bot commented Sep 1, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vinokurig

The full list of commands accepted by this bot can be found 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

throw new IOException(
"Only http and https URLs are allowed, got: " + scheme + " in URL " + url);
}
URLConnection connection = parsedUrl.openConnection();
… providers

Restrict URL fetching to http/https schemes only, rejecting file://, ftp://, jar:, and other
schemes that could be exploited to read local files or access cloud metadata endpoints.
Also fix incorrect null-check in ScmService that validated `repository` twice instead of `filePath`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-server:pr-1048

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/cheServer/deployment", "value": {containers: [{image: "quay.io/eclipse/che-server:pr-1048", name: che}]}}]"

@vinokurig

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

@vinokurig: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v19-gitlab-with-pat-setup-flow ab85ad4 link true /test v19-gitlab-with-pat-setup-flow
ci/prow/v19-gitlab-no-pat-oauth-flow-raw-devfile-url ab85ad4 link true /test v19-gitlab-no-pat-oauth-flow-raw-devfile-url
ci/prow/v19-azure-no-pat-oauth-flow ab85ad4 link true /test v19-azure-no-pat-oauth-flow
ci/prow/v19-github-no-pat-oauth-flow ab85ad4 link true /test v19-github-no-pat-oauth-flow
ci/prow/v19-azure-with-pat-setup-flow ab85ad4 link true /test v19-azure-with-pat-setup-flow
ci/prow/v19-github-with-pat-setup-flow ab85ad4 link true /test v19-github-with-pat-setup-flow
ci/prow/v19-che-smoke-test ab85ad4 link true /test v19-che-smoke-test

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.

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.

2 participants