Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 9, 2024

Conversation

eason9487
Copy link
Member

@eason9487 eason9487 commented May 9, 2024

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
Copy link
Contributor

@martynmjones martynmjones left a comment

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
4 checks passed
@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