Skip to content

Conversation

arjunsuresh
Copy link
Collaborator

Potential fix for https://github.com/mlcommons/mlperf-automations/security/code-scanning/13

To fix the code injection vulnerability, you should assign the untrusted input (${{ github.event.pull_request.head.ref }}) to an intermediate environment variable in the workflow step. Then in the shell command, use the native shell substitution ($BRANCH) rather than injecting the value in the script with GitHub Actions ${{ ... }} syntax. This mitigates code injection risks by ensuring the shell interprets it as a single argument and not as a sequence of commands.

Specifically, edit the step "Pull MLOps repository" in .github/workflows/test-mlperf-inference-rgat.yml, lines 35-36, so that an environment variable (e.g., BRANCH) is set to ${{ github.event.pull_request.head.ref }} and then referenced as $BRANCH in the shell command. No additional imports or definitions are necessary for this change.

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

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Sep 4, 2025

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@arjunsuresh arjunsuresh marked this pull request as ready for review September 4, 2025 15:51
@arjunsuresh arjunsuresh requested a review from a team as a code owner September 4, 2025 15:51
@anandhu-eng anandhu-eng merged commit 904c3e0 into main Sep 4, 2025
98 of 102 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2025
@anandhu-eng anandhu-eng deleted the alert-autofix-13 branch September 13, 2025 02:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants