Skip to content

Commit aba8dd0

Browse files
committed
fix(security): prevent command injection in GitHub Actions workflows
- Use environment variables instead of direct interpolation for user inputs - Add proper quoting for environment variables in shell commands - Fix create-release.yml: use INPUT_VERSION env var for inputs.version - Fix retry-workflow.yml: use RUN_ID env var for inputs.run_id Resolves high-severity security vulnerability in workflow variable interpolation
1 parent 752a81f commit aba8dd0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

‎.github/workflows/create-release.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ jobs:
2828
exit 1
2929
3030
- name: Write release version env vars (with/without v)
31+
env:
32+
INPUT_VERSION: ${{ inputs.version }}
3133
run: |
32-
VERSION_NAME="v${{ inputs.version }}"
34+
VERSION_NAME="v$INPUT_VERSION"
3335
VERSION_NUMBER="${VERSION_NAME:1}"
3436
echo "VERSION_NUMBER=${VERSION_NUMBER}" >> $GITHUB_ENV
3537
echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_ENV

‎.github/workflows/retry-workflow.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
env:
1515
GH_REPO: ${{ github.repository }}
1616
GH_TOKEN: ${{ github.token }}
17+
RUN_ID: ${{ inputs.run_id }}
1718
run: |
18-
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
19-
gh run rerun ${{ inputs.run_id }} --failed
19+
gh run watch "$RUN_ID" > /dev/null 2>&1
20+
gh run rerun "$RUN_ID" --failed

0 commit comments

Comments
 (0)