Skip to content

Commit 7c7bbc7

Browse files
Harden release.yml workflow
Prevent shell injection in this workflow by capturing the update type as an environment variable and using the environment variable. This way, the expansion of the input in the command can't result in shell injection. Yes, this particular case is not very vulnerable due to 1) limited value space, and 2) trusted triggers. However, it's hard to guarantee those variables stay fixed and simple to apply the fix. This problem was detected by Semgrep (https://semgrep.dev) using a full- repository scan.
1 parent 1fb72a1 commit 7c7bbc7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/release.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ jobs:
4747
app_id: ${{ secrets.RELEASE_APP_ID }}
4848
private_key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
4949
- name: Bump version
50-
run: node scripts/bump-version.js '${{ github.event.inputs.update_type }}'
50+
env:
51+
UPDATE_TYPE: ${{ github.event.inputs.update_type }}
52+
run: node scripts/bump-version.js "$UPDATE_TYPE"
5153
- name: Update the changelog
5254
run: node scripts/bump-changelog.js
5355
- name: Create Pull Request

0 commit comments

Comments
 (0)