Potential fix for code scanning alert no. 1: Cache Poisoning via low-privileged code injection#2164
Merged
kevinjqliu merged 2 commits intomainfrom Feb 24, 2026
Merged
Potential fix for code scanning alert no. 1: Cache Poisoning via low-privileged code injection#2164kevinjqliu merged 2 commits intomainfrom
kevinjqliu merged 2 commits intomainfrom
Conversation
…privileged code injection Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Contributor
Author
blackmwk
approved these changes
Feb 24, 2026
Contributor
blackmwk
left a comment
There was a problem hiding this comment.
Thanks @kevinjqliu for this fix!
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Potential fix for https://github.com/apache/iceberg-rust/security/code-scanning/1
To fix the issue, pass
github.event.workflow_run.head_branchinto the shell as an environment variable instead of interpolating it directly in the script, and then reference only the environment variable inside therunblock. 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 formatstep:env:section with two variables:DISPATCH_RELEASE_TAG: ${{ github.event.inputs.release_tag }}RUN_HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}${{ github.event.inputs.release_tag }}and${{ github.event.workflow_run.head_branch }}in the shell script with$DISPATCH_RELEASE_TAGand$RUN_HEAD_BRANCHrespectively.This change is all within
.github/workflows/release_python.yml, in thevalidate-release-tagjob,Validate release tag formatstep. 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