Skip to content

Commit 037fbef

Browse files
authored
build: Fix command injection possibility in playwright GHA (#16510)
resolves https://linear.app/getsentry/issue/FE-484 > Using variable interpolation ${{...}} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".
1 parent 50e2646 commit 037fbef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/actions/install-playwright/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ runs:
3434
working-directory: ${{ inputs.cwd }}
3535

3636
- name: Install Playwright system dependencies only (cached)
37-
run: npx playwright install-deps ${{ inputs.browsers || 'chromium webkit firefox' }}
37+
env:
38+
PLAYWRIGHT_BROWSERS: ${{ inputs.browsers || 'chromium webkit firefox' }}
39+
run: npx playwright install-deps "$PLAYWRIGHT_BROWSERS"
3840
if: steps.playwright-cache.outputs.cache-hit == 'true'
3941
shell: bash
4042
working-directory: ${{ inputs.cwd }}

0 commit comments

Comments
 (0)