Skip to content

Comments

Potential fix for code scanning alert no. 1: Cache Poisoning via low-privileged code injection#2164

Merged
kevinjqliu merged 2 commits intomainfrom
alert-autofix-1
Feb 24, 2026
Merged

Potential fix for code scanning alert no. 1: Cache Poisoning via low-privileged code injection#2164
kevinjqliu merged 2 commits intomainfrom
alert-autofix-1

Conversation

@kevinjqliu
Copy link
Contributor

@kevinjqliu kevinjqliu commented Feb 23, 2026

Potential fix for https://github.com/apache/iceberg-rust/security/code-scanning/1

To fix the issue, pass github.event.workflow_run.head_branch into the shell as an environment variable instead of interpolating it directly in the script, and then reference only the environment variable inside the run block. This follows the safer pattern from the “Secure Workflow” example, where GitHub expressions are resolved into environment variables and then treated as inert data.

Concretely, update the Validate release tag format step:

  • Add an env: section with two variables:
    • DISPATCH_RELEASE_TAG: ${{ github.event.inputs.release_tag }}
    • RUN_HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
  • Replace the direct usages of ${{ github.event.inputs.release_tag }} and ${{ github.event.workflow_run.head_branch }} in the shell script with $DISPATCH_RELEASE_TAG and $RUN_HEAD_BRANCH respectively.

This change is all within .github/workflows/release_python.yml, in the validate-release-tag job, Validate release tag format step. No new methods, external definitions, or imports are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Tested

On fork repo github action run:
https://github.com/kevinjqliu/iceberg-rust/actions/runs/22290533306

…privileged code injection

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@kevinjqliu kevinjqliu marked this pull request as ready for review February 23, 2026 02:07
@kevinjqliu
Copy link
Contributor Author

kevinjqliu commented Feb 23, 2026

CI blocked, #2165 #2166 should fix it

Copy link
Contributor

@blackmwk blackmwk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kevinjqliu for this fix!

@kevinjqliu kevinjqliu merged commit 6a01be7 into main Feb 24, 2026
20 checks passed
@kevinjqliu kevinjqliu deleted the alert-autofix-1 branch February 24, 2026 01:52
@kevinjqliu
Copy link
Contributor Author

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