Skip to content

Fix cache poisoning vulnerability in GitHub Actions#679

Merged
leouieda merged 6 commits into
mainfrom
cache-poisoning
May 20, 2026
Merged

Fix cache poisoning vulnerability in GitHub Actions#679
leouieda merged 6 commits into
mainfrom
cache-poisoning

Conversation

@leouieda
Copy link
Copy Markdown
Member

@leouieda leouieda commented May 19, 2026

Zizmor raised an error because of cache poisoning, which is where an atacker can hide a malicious payload to cached data and gain access to other workflows when the cache is restored. This could be used to corrupt a release artifact when the release workflow uses caching. We did this in our docs workflow. We also uploaded artifacts of the docs and PyPI distributions and then restored them. Seems like this should also be vulnerable to similar atacks. To avoid all of this, redo the way we deploy in Actions. Add a separate publish workflow that only runs on pushes to main and releases. It builds the docs and wheels, then publishes them to GitHub pages and PyPI/TestPyPI all in the same job without using caching or artifacts. The docs workflow only builds the docs and doesn't deploy them anymore. The pypi workflow was removed, with the check of the built packages living in the test workflow now.

Relevant issues/PRs: Related to fatiando/bordado#115

leouieda added 3 commits May 19, 2026 14:31
Zizmor raised an error because of [cache
poisoning](https://docs.zizmor.sh/audits/#cache-poisoning), which is
where an atacker can hide a malicious payload to cached data and gain
access to other workflows when the cache is restored. This could be used
to corrupt a release artifact when the release workflow uses caching.
We did this in our docs workflow. We also uploaded artifacts of the docs
and PyPI distributions and then restored them. Seems like this should
also be vulnerable to similar atacks. To avoid all of this, redo the way
we deploy in Actions. Add a separate `publish` workflow that only runs
on pushes to `main` and releases. It builds the docs and wheels, then
publishes them to GitHub pages and PyPI/TestPyPI all in the same job
without using caching or artifacts. The `docs` workflow only builds the
docs and doesn't deploy them anymore. The `pypi` workflow was removed,
with the check of the built packages living in the `test` workflow now.
@leouieda
Copy link
Copy Markdown
Member Author

Updated the PyPI and TestPyPI publishing config to match.

@leouieda leouieda merged commit a3a57f7 into main May 20, 2026
14 checks passed
@leouieda leouieda deleted the cache-poisoning branch May 20, 2026 13:18
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.

1 participant