Fix command injection in required-field-check workflow #3642
Open
varadarajan-tw wants to merge 2 commits intomainfrom
Open
Fix command injection in required-field-check workflow #3642varadarajan-tw wants to merge 2 commits intomainfrom
varadarajan-tw wants to merge 2 commits intomainfrom
Conversation
Remediate OS command injection vulnerability where PR filenames containing
shell metacharacters (e.g., $()) could execute arbitrary commands on the
Actions runner. Untrusted filenames from the GitHub API were interpolated
unquoted into bash via ${{ }} expressions.
Fix: output files as JSON array, pass through env variable (not inline
interpolation), parse safely with jq, and build args with proper quoting.
Ref: HackerOne #3526875
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New destinations have no existing customers and new actions have no existing configurations, so adding required fields to them is safe. Only warn when required fields are added to actions/settings that already exist on main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
required-field-checkGitHub Actions workflow${{ }}expressions, allowing arbitrary command execution if a filename contained shell metacharacters like$()${{ }}interpolation), parse safely withjq, and construct args with proper bash array quotingJIRA - https://twilio-engineering.atlassian.net/browse/SECOPS-23951
Test plan
Required Field Checkworkflow passes on this PRTest: Verified that filenames with shell metacharacters are treated as literals and not executed.
Input: JSON array with malicious filename
CHANGED_FILES='["file1.ts", "file$(echo INJECTED).ts", "file with spaces.ts"]'
Parse with jq (new safe method)
while IFS= read -r file; do
ARGS+=(-p "$file")
done < <(echo "$CHANGED_FILES" | jq -r '.[]')
Result:
🤖 Generated with Claude Code