Skip to content

Fix potential vulnerability in CI workflow#2

Open
joewallwork wants to merge 2 commits intodevelopfrom
fix-ci-vulnerability
Open

Fix potential vulnerability in CI workflow#2
joewallwork wants to merge 2 commits intodevelopfrom
fix-ci-vulnerability

Conversation

@joewallwork
Copy link
Collaborator

Supersedes #1.

As noted in geoschem#86, without the edits to the cloud benchmarking workflow in this PR, the zizmor GitHub Actions static analysis tool reports:

error[template-injection]: code injection via template expansion
  --> /home/joe/software/GCClassic/.github/workflows/cloud-benchmarking-workflow.yml:45:9
   |
45 |         - name: Reset Initial Variables for pull request
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this step
46 | /         run: |
47 | |           echo "GITHUB_SHA_SHORT=`echo ${{ github.event.pull_request.head.sha }} | cut -c1-7`" >> $GITHUB_ENV
48 | |           echo "COMMIT_NAME=`echo ${{ github.event.pull_request.head.sha }} | cut -c1-7`" >> $GITHUB_ENV
   | |________________________________________________________________________________________________________^ github.event.pull_request.head.sha may expand into attacker-controllable code
   |
   = note: audit confidence → High

error[template-injection]: code injection via template expansion
  --> /home/joe/software/GCClassic/.github/workflows/cloud-benchmarking-workflow.yml:45:9
   |
45 |         - name: Reset Initial Variables for pull request
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this step
46 | /         run: |
47 | |           echo "GITHUB_SHA_SHORT=`echo ${{ github.event.pull_request.head.sha }} | cut -c1-7`" >> $GITHUB_ENV
48 | |           echo "COMMIT_NAME=`echo ${{ github.event.pull_request.head.sha }} | cut -c1-7`" >> $GITHUB_ENV
   | |________________________________________________________________________________________________________^ github.event.pull_request.head.sha may expand into attacker-controllable code
   |
   = note: audit confidence → High

@joewallwork joewallwork added the bug Something isn't working label Mar 31, 2025
@joewallwork joewallwork self-assigned this Mar 31, 2025
@joewallwork joewallwork requested a review from ltmurray March 31, 2025 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant