Skip to content

ci: fix expression injection in pr-target-branch.yml#19095

Open
XananasX7 wants to merge 1 commit into
influxdata:masterfrom
XananasX7:fix/ci-expression-injection-pr-target-branch
Open

ci: fix expression injection in pr-target-branch.yml#19095
XananasX7 wants to merge 1 commit into
influxdata:masterfrom
XananasX7:fix/ci-expression-injection-pr-target-branch

Conversation

@XananasX7

Copy link
Copy Markdown

The debug step in pr-target-branch.yml passed
github.event.pull_request.base.ref directly into a shell command:

run: echo Target is ${{ github.event.pull_request.base.ref }}

A pull request whose base branch name contains shell metacharacters
(semicolon, backtick, dollar-parenthesis, quotes, etc.) could cause
unintended command execution or output corruption in the runner.

Fix: move the value into a BASE_REF env: variable at the step level
and reference it as "${BASE_REF}" in the shell command.

This follows the safe interpolation pattern from GitHub's security
hardening for GitHub Actions guide.

No behaviour change is intended.

The debug step passed github.event.pull_request.base.ref directly
into a shell echo command:

  run: echo Target is ${{ github.event.pull_request.base.ref }}

A base branch name containing shell metacharacters would cause
unintended command execution or output corruption.

Fix: move the value into a BASE_REF env: variable and echo it as
a quoted ${BASE_REF} string.

No behaviour change is intended.
@telegraf-tiger

Copy link
Copy Markdown
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger Bot added the ci CI pipeline fixes, optimizations, and infrastructure label Jun 13, 2026
@XananasX7

Copy link
Copy Markdown
Author

!signed-cla — I've signed the InfluxData CLA at https://www.influxdata.com/legal/cla/ using mehdiananas007@gmail.com. Please let me know if there's anything else needed to unblock the review. Thank you!

@srebhan

srebhan commented Jun 15, 2026

Copy link
Copy Markdown
Member

@XananasX7 for the CLA you need to use the same email you use for your Github account...

@srebhan

srebhan commented Jun 23, 2026

Copy link
Copy Markdown
Member

!signed-cla

@srebhan

srebhan commented Jun 23, 2026

Copy link
Copy Markdown
Member

@XananasX7 please also restore the PR description template, especially the AI part and fill it in as we cannot review the PR otherwise...

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

Labels

ci CI pipeline fixes, optimizations, and infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants