Skip to content

Avoid running untrusted input as shell commands in the GitHub Actions#2394

Merged
eason9487 merged 1 commit into
developfrom
dev/fix-gha-untrusted-input
May 9, 2024
Merged

Avoid running untrusted input as shell commands in the GitHub Actions#2394
eason9487 merged 1 commit into
developfrom
dev/fix-gha-untrusted-input

Conversation

@eason9487

@eason9487 eason9487 commented May 9, 2024

Copy link
Copy Markdown
Member

Changes proposed in this Pull Request:

This PR avoids running untrusted inputs as shell command in the GitHub Actions.

Ref: https://securitylab.github.com/research/github-actions-untrusted-input/

Detailed test instructions:

  1. View the workflow that simulates the same uses of ${{ github.head_ref }} in this repo
  2. View a test PR trying to inject command ls -la via branch name zzz";ls${IFS}-la;#
  3. View the workflow run that was injected shell command ls -la from a forked repo
  4. View the fix commit
  5. View the workflow run that avoids the shell command injections
  6. Check if the "Build" workflow run in this repo is successful

Changelog entry

@eason9487 eason9487 requested a review from a team May 9, 2024 04:24
@eason9487 eason9487 self-assigned this May 9, 2024
@github-actions github-actions Bot added the changelog: dev Developer-facing only change. label May 9, 2024
@eason9487 eason9487 changed the title Avoid running untrusted inputs as shell command in the GitHub Actions Avoid running untrusted input as shell commands in the GitHub Actions May 9, 2024

@martynmjones martynmjones left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @eason9487, thanks for keeping our repo's safe!

Changes look good and I'm not seeing any other variables at risk of injection ✅

@eason9487 eason9487 merged commit 53743a9 into develop May 9, 2024
@eason9487 eason9487 deleted the dev/fix-gha-untrusted-input branch May 9, 2024 08:37
@puntope puntope mentioned this pull request May 14, 2024
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: dev Developer-facing only change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants