Skip to content

Commit a6166b8

Browse files
committed
Fix template injection vulnerability in signing-event action
Use environment variable instead of direct template expansion to prevent code injection via inputs.base-branch parameter
1 parent c77d6eb commit a6166b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

actions/signing-event/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ runs:
3535
persist-credentials: true
3636

3737
- id: detect-base-branch
38+
env:
39+
INPUT_BASE_BRANCH: ${{ inputs.base-branch }}
3840
run: |
39-
if [ -n "${{ inputs.base-branch }}" ]; then
40-
echo "base-branch=${{ inputs.base-branch }}" >> $GITHUB_OUTPUT
41+
if [ -n "$INPUT_BASE_BRANCH" ]; then
42+
echo "base-branch=$INPUT_BASE_BRANCH" >> $GITHUB_OUTPUT
4143
else
4244
# Try to auto-detect default branch
4345
BASE_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main")

0 commit comments

Comments
 (0)