Skip to content

Potential fix for environment variable built from user-controlled sources#38942

Draft
derrickaw wants to merge 1 commit into
masterfrom
alert-autofix-1
Draft

Potential fix for environment variable built from user-controlled sources#38942
derrickaw wants to merge 1 commit into
masterfrom
alert-autofix-1

Conversation

@derrickaw

@derrickaw derrickaw commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

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

Use strict parsing + sanitization before writing to $GITHUB_ENV:

  • Read only the first sdk_version= line from gradle.properties.
  • Extract the value safely.
  • Reject values containing CR/LF (prevents env-file line injection).
  • Optionally validate expected version format to keep behavior aligned with intended semantics.
  • Write using printf to avoid shell echo quirks.

Change only .github/workflows/beam_Publish_Beam_SDK_Snapshots.yml in the Find Beam Version step (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

…rces

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions github-actions Bot added the build label Jun 12, 2026
@derrickaw derrickaw changed the title Potential fix for code scanning alert no. 1: Environment variable built from user-controlled sources Potential fix for environment variable built from user-controlled sources Jun 12, 2026
@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant