Skip to content

Fix shell injection vulnerability in test-powershell-module.yml workflow#40

Open
fix-it-felix-sentry[bot] wants to merge 1 commit intomainfrom
fix-vuln-1092-gdx-418-shell-injection
Open

Fix shell injection vulnerability in test-powershell-module.yml workflow#40
fix-it-felix-sentry[bot] wants to merge 1 commit intomainfrom
fix-vuln-1092-gdx-418-shell-injection

Conversation

@fix-it-felix-sentry
Copy link

Summary

This PR fixes a high-severity shell injection vulnerability in the GitHub Actions workflow file .github/workflows/test-powershell-module.yml.

Changes

Replaced direct interpolation of ${{ inputs.* }} expressions in run: steps with environment variables to prevent potential code injection attacks. This follows GitHub's security best practices for handling untrusted input in workflows.

Vulnerable code pattern (before):

run: |
  Write-Host "Running tests for ${{ inputs.module-name }} module..."

Fixed code pattern (after):

env:
  MODULE_NAME: ${{ inputs.module-name }}
run: |
  Write-Host "Running tests for $env:MODULE_NAME module..."

Security Impact

The previous implementation was vulnerable to shell injection attacks where malicious input could execute arbitrary code in the GitHub Actions runner. This could potentially:

  • Steal secrets and credentials
  • Modify code or workflow results
  • Compromise the CI/CD pipeline

References

Use environment variables instead of direct interpolation of github context
data in run steps to prevent potential code injection attacks.

Fixes:
- Parent ticket: https://linear.app/getsentry/issue/VULN-1092
- Child ticket: https://linear.app/getsentry/issue/GDX-418

Co-Authored-By: fix-it-felix-sentry[bot] <260785270+fix-it-felix-sentry[bot]@users.noreply.github.com>
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.

0 participants