Skip to content

Commit 07d2dce

Browse files
authored
security(gha): fix potential for shell injection (#4099)
Running these workflows is gated pretty well, but this mitigates the potential for a script injection attack by passing the input to an intermediary environment variable first. See https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#example-of-a-script-injection-attack for more details.
1 parent 189e4a9 commit 07d2dce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/release-comment-issues.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ jobs:
1717
steps:
1818
- name: Get version
1919
id: get_version
20-
run: echo "version=${{ github.event.inputs.version || github.event.release.tag_name }}" >> $GITHUB_OUTPUT
20+
env:
21+
INPUTS_VERSION: ${{ github.event.inputs.version }}
22+
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
23+
run: echo "version=${$INPUTS_VERSION:-$RELEASE_TAG_NAME}" >> "$GITHUB_OUTPUT"
2124

2225
- name: Comment on linked issues that are mentioned in release
2326
if: |
@@ -28,4 +31,4 @@ jobs:
2831
uses: getsentry/release-comment-issues-gh-action@v1
2932
with:
3033
github_token: ${{ secrets.GITHUB_TOKEN }}
31-
version: ${{ steps.get_version.outputs.version }}
34+
version: ${{ steps.get_version.outputs.version }}

0 commit comments

Comments
 (0)