Skip to content

Fix GitHub Actions shell injection vulnerability#29656

Open
fr4iser90 wants to merge 1 commit intoanthropics:mainfrom
fr4iser90:fix/github-actions-shell-injection-v2
Open

Fix GitHub Actions shell injection vulnerability#29656
fr4iser90 wants to merge 1 commit intoanthropics:mainfrom
fr4iser90:fix/github-actions-shell-injection-v2

Conversation

@fr4iser90
Copy link

  • Move all GitHub context variables to env: section
  • Use environment variables instead of direct interpolation in shell commands
  • Prevents code injection via workflow_dispatch inputs
  • Fixes Semgrep ERROR: yaml.github-actions.security.run-shell-injection

This change ensures that user-controlled inputs (like issue_number) and GitHub context variables (repository, event_name, run_id) are safely passed as environment variables rather than being directly interpolated into shell commands, preventing potential command injection attacks.

- Move all GitHub context variables to env: section
- Use environment variables instead of direct interpolation in shell commands
- Prevents code injection via workflow_dispatch inputs
- Fixes Semgrep ERROR: yaml.github-actions.security.run-shell-injection

This change ensures that user-controlled inputs (like issue_number) and
GitHub context variables (repository, event_name, run_id) are safely
passed as environment variables rather than being directly interpolated
into shell commands, preventing potential command injection attacks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant