You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent script injection by using environment variables
Fix GitHub Actions script injection vulnerability by using intermediate
environment variables instead of direct interpolation of github context
data in run steps.
Changes:
- updater/action.yml: Use env vars for inputs.name, inputs.path,
inputs.changelog-entry, inputs.pr-strategy, and inputs.post-update-script
- sentry-cli/integration-test/action.yml: Use env vars for
github.action_path and inputs.path
This prevents potential code injection attacks where untrusted input
could be executed as shell commands.
Fixes: https://linear.app/getsentry/issue/VULN-1100
Fixes: https://linear.app/getsentry/issue/DI-1657
# Validate that inputs.post-update-script contains only safe characters
119
-
if ('${{ inputs.post-update-script }}' -notmatch '^[a-zA-Z0-9_\./#\s-]+$') {
120
-
Write-Output "::error::Invalid post-update-script path: '${{ inputs.post-update-script }}'. Only alphanumeric characters, spaces, and _-./# are allowed."
129
+
if ("$env:POST_UPDATE_SCRIPT" -notmatch '^[a-zA-Z0-9_\./#\s-]+$') {
130
+
Write-Output "::error::Invalid post-update-script path: '$env:POST_UPDATE_SCRIPT'. Only alphanumeric characters, spaces, and _-./# are allowed."
121
131
exit 1
122
132
}
123
-
Write-Output "✓ Post-update script path '${{ inputs.post-update-script }}' is valid"
133
+
Write-Output "✓ Post-update script path '$env:POST_UPDATE_SCRIPT' is valid"
0 commit comments