Skip to content

Escape user controlled input in prow.sh#307

Merged
k8s-ci-robot merged 1 commit into
kubernetes-csi:masterfrom
mattcary:prow
May 23, 2026
Merged

Escape user controlled input in prow.sh#307
k8s-ci-robot merged 1 commit into
kubernetes-csi:masterfrom
mattcary:prow

Conversation

@mattcary
Copy link
Copy Markdown
Contributor

An attacker submitting a malicious Pull Request can execute arbitrary shell commands inside the CI runner container.

The snapshot controller yaml from an untrusted pull request is read line by line, and the image: value is extracted into '$image' without any escaping or sanitization. This varible is then used directly ina double-quoted 'sed -e' command string, allowing the user to break out of the 's' command using ';' and execute arbitrary 'sed' extensions like 'e' (execute shell command).

Escape user-supplied image string in prow.sh

An attacker submitting a malicious Pull Request can execute arbitrary
shell commands inside the CI runner container.

The snapshot controller yaml from an untrusted pull request is read
line by line, and the image: value is extracted into '$image' without
any escaping or sanitization.  This varible is then used directly ina
double-quoted 'sed -e' command string, allowing the user to break out
of the 's' command using ';' and execute arbitrary 'sed' extensions
like 'e' (execute shell command).

```release-note
Escape user-supplied image string in prow.sh
```
@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 22, 2026
@k8s-ci-robot k8s-ci-robot requested review from humblec and pohly May 22, 2026 18:40
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 22, 2026
@xing-yang
Copy link
Copy Markdown
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 23, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattcary, xing-yang

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 23, 2026
@k8s-ci-robot k8s-ci-robot merged commit 31186bf into kubernetes-csi:master May 23, 2026
8 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants