Skip to content

Hash pin GitHub Actions - #173

Merged
hugovk merged 1 commit into
ofek:masterfrom
hugovk:hash-pin-gha
Apr 28, 2026
Merged

Hash pin GitHub Actions#173
hugovk merged 1 commit into
ofek:masterfrom
hugovk:hash-pin-gha

Conversation

@hugovk

@hugovk hugovk commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Yet another compromise via unpinned GitHub Actions: https://socket.dev/blog/bitwarden-cli-compromised

Let's hash-pin GHA.

Done via uvx gha-update.

@codecov

codecov Bot commented Apr 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0720138) to head (643172e).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #173   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          547       558   +11     
  Branches        74        43   -31     
=========================================
+ Hits           547       558   +11     
Flag Coverage Δ
macOS-latest 100.00% <ø> (ø)
ubuntu-latest 100.00% <ø> (ø)
windows-latest 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hugovk

hugovk commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator Author

Yet another, this time via template injection:

https://www.stepsecurity.io/blog/elementary-data-compromised-on-pypi-and-ghcr-forged-release-pushed-via-github-actions-script-injection

Will merge this, then open another to add https://github.com/zizmorcore/zizmor to pre-commit and fix its findings.

@hugovk
hugovk merged commit 3950b39 into ofek:master Apr 28, 2026
18 checks passed
@hugovk
hugovk deleted the hash-pin-gha branch April 28, 2026 09:39
@mara004

mara004 commented Jun 29, 2026

Copy link
Copy Markdown

Have any of the standard actions like actions/checkout or actions/setup-python ever been compromised, or is that a realistic threat in the future?

Should I hash pin all actions, including the standard ones, in my projects too? Any tips how to mitigate the maintenance trouble that may cause? e.g. is there a specific dependabot configuration or other automation you would recommend, aside from that uvx command?

@hugovk

hugovk commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

Have any of the standard actions like actions/checkout or actions/setup-python ever been compromised, or is that a realistic threat in the future?

I don't think they have, but I find it easier to pin them all together, and update them all together. One less thing to worry about and configure.

Should I hash pin all actions, including the standard ones, in my projects too?

Yes.

Any tips how to mitigate the maintenance trouble that may cause? e.g. is there a specific dependabot configuration or other automation you would recommend, aside from that uvx command?

Update with either Dependabot or Renovate, they're both good. For Dependabot, I recommend something like https://github.com/python/cpython/blob/main/.github/dependabot.yml which has:

I also recommend running zizmor and fixing the findings, and then putting it in your CI. https://zizmor.sh/

@mara004

mara004 commented Jun 30, 2026

Copy link
Copy Markdown

Thanks a lot for the advice, I will do that.

I'm aware of zizmor, and fixed all the template-injection warnings some time ago. I don't think any of them was actually attacker-controllable, but important to avoid all the same.

There are some other warnings that I'm not so sure how to fix though, without potentially going through a lot of breakage first (e.g. default permissions warnings).

@mara004

mara004 commented Jul 5, 2026

Copy link
Copy Markdown

I've started hash-pinning all actions across my projects: pypdfium2-team/gn-dist@983db9e, pypdfium2-team/ctypesgen@7d7fc4c. Also pypdfium2-team/pypdfium2@83ea72e once pypdfium2-team/pypdfium2#461 is merged.

I've set monthly updates + a cooldown of 10 days for now. Let's see how that goes. If it still annoys me, I might go for quarterly + 14 days.

@ofek

ofek commented Jul 5, 2026

Copy link
Copy Markdown
Owner

It is taxing, which is why large organizations allow (with some caveats/exceptions) dependency updates to be automatically merged if CI passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants