Skip to content

[release-5.0] OCPNODE-4526: Block '..' traversal in StorePath - #3020

Open
saschagrunert wants to merge 1 commit into
openshift:release-5.0from
saschagrunert:release-5.0
Open

[release-5.0] OCPNODE-4526: Block '..' traversal in StorePath#3020
saschagrunert wants to merge 1 commit into
openshift:release-5.0from
saschagrunert:release-5.0

Conversation

@saschagrunert

Copy link
Copy Markdown
Member

Backport of #2999 to release-5.0.

Add a CEL XValidation rule to the StorePath type that rejects paths containing '..' components. This prevents directory traversal sequences from passing API validation, even though containers/storage normalizes them downstream via filepath.Clean().

Update the StorePath and path field godocs to document the '..' restriction per OpenShift API conventions.

Add test cases for '..' traversal and ':' in paths.

Use component-level CEL validation to reject '..' path components
while allowing '..' within filenames (e.g. /var/lib/foo..bar).
Add ratcheting tests to verify existing invalid paths don't block
updates to adjacent fields.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@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 the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 2, 2026
@openshift-ci-robot

openshift-ci-robot commented Sep 2, 2026

Copy link
Copy Markdown

@saschagrunert: This pull request references OCPNODE-4526 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Backport of #2999 to release-5.0.

Add a CEL XValidation rule to the StorePath type that rejects paths containing '..' components. This prevents directory traversal sequences from passing API validation, even though containers/storage normalizes them downstream via filepath.Clean().

Update the StorePath and path field godocs to document the '..' restriction per OpenShift API conventions.

Add test cases for '..' traversal and ':' in paths.

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.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b74a7f23-43b2-4ddd-8572-cec098d8751d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Hello @saschagrunert! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 2, 2026
@saschagrunert saschagrunert changed the title OCPNODE-4526: Block '..' traversal in StorePath [release-5.0] OCPNODE-4526: Block '..' traversal in StorePath Sep 2, 2026
@saschagrunert

Copy link
Copy Markdown
Member Author

/test integration

@everettraven

Copy link
Copy Markdown
Contributor

/approve
/lgtm

/label backport-risk-assessed

@saschagrunert is this a release-blocker? If not, this should probably be held to go into a 5.0.z at this point.

/hold

@openshift-ci openshift-ci Bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. labels Sep 2, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 2, 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-aws-ovn
/test e2e-aws-ovn-hypershift
/test e2e-aws-ovn-hypershift-conformance
/test e2e-aws-ovn-techpreview
/test e2e-aws-serial-1of2
/test e2e-aws-serial-2of2
/test e2e-aws-serial-techpreview-1of2
/test e2e-aws-serial-techpreview-2of2
/test e2e-azure
/test e2e-gcp
/test e2e-upgrade
/test e2e-upgrade-out-of-change

@openshift-ci

openshift-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: everettraven

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 Sep 2, 2026
@openshift-ci

openshift-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@saschagrunert: 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/e2e-aws-serial-techpreview-2of2 7b0ed45 link true /test e2e-aws-serial-techpreview-2of2
ci/prow/e2e-aws-ovn-hypershift-conformance 7b0ed45 link true /test e2e-aws-ovn-hypershift-conformance
ci/prow/e2e-aws-ovn 7b0ed45 link true /test e2e-aws-ovn
ci/prow/e2e-gcp 7b0ed45 link true /test e2e-gcp
ci/prow/e2e-aws-serial-2of2 7b0ed45 link true /test e2e-aws-serial-2of2

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.

@saschagrunert

Copy link
Copy Markdown
Member Author

/approve /lgtm

/label backport-risk-assessed

@saschagrunert is this a release-blocker? If not, this should probably be held to go into a 5.0.z at this point.

/hold

Not a release blocker. 👍

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants