Potential fix for environment variable built from user-controlled sources - #38942
Conversation
…rces Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
/gemini review |
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
Assigning reviewers: R: @Abacn for label build. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
Reminder, please take a look at this pr: @Abacn |
|
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment R: @liferoad for label build. Available commands:
|
|
Reminder, please take a look at this pr: @liferoad |
|
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment R: @Abacn for label build. Available commands:
|
|
Reminder, please take a look at this pr: @Abacn |
|
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment R: @liferoad for label build. Available commands:
|
|
Reminder, please take a look at this pr: @liferoad |
bvolpato
left a comment
There was a problem hiding this comment.
Thanks for tightening this up. I think this still needs one change before it fixes the alert: grep -q $'[\r\n]' is invalid under GNU grep (Unmatched [; exit 2). Since the if treats that as no match, a CR in sdk_version proceeds to printf and can create another environment-file assignment.
A shell case check (*$'\r'*|*$'\n'*) or valid byte check would reject it. Could you update that guard?
…rces (apache#38942) * Potential fix for Environment variable built from user-controlled sources Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * update return/new line guard --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…rces (apache#38942) * Potential fix for Environment variable built from user-controlled sources Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * update return/new line guard --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Potential fix for https://github.com/apache/beam/security/code-scanning/1
Use strict parsing + sanitization before writing to
$GITHUB_ENV:sdk_version=line fromgradle.properties.printfto avoid shell echo quirks.Change only
.github/workflows/beam_Publish_Beam_SDK_Snapshots.ymlin theFind Beam Versionstep (lines around 90–92). No import/dependency changes are needed.Suggested fixes powered by Copilot Autofix. Review carefully before merging.
run - https://github.com/apache/beam/actions/runs/27416123769
rerun - https://github.com/apache/beam/actions/runs/30821283730