-
-
Notifications
You must be signed in to change notification settings - Fork 222
chore(security): remove GitHub Actions caching to prevent cache poisoning #1209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Updated the publish-release GitHub Actions workflow to use newer versions of actions and removed the dry-run step for npm publish.
chakra-guy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
I don't understand this. If files are cached, surely their checksumms are verified after downloading. If so it doesn't matter if it's cached or not, so it can be cached for perf reasons. No? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1209 +/- ##
=======================================
Coverage 74.05% 74.05%
=======================================
Files 182 182
Lines 4351 4351
Branches 1066 1066
=======================================
Hits 3222 3222
Misses 1129 1129 ☔ View full report in Codecov by Sentry. |
|
|
@paulmillr behind the scenes When a cache is to be restored, it is downloaded into a temp directory, and then extracted. This extraction happens relative to the GITHUB_WORKSPACE directory (generally the repository's root), and will override any existing files that have the same path. This means that if someone were to poison the cache to include a malicious |
|
@NicholasEllul that sounds idiotic and is a real security issue. Why does GitHub allow it? |
|
@paulmillr Originally when a security researcher had reported the issue to them, GitHub had dismissed it (Blog post). However, the issue has since been seen exploited in the wild, and people have started to create more noise around it. Per their comment, it sounds like they are exploring how this can be improved. Until then, we do not consider it safe to use action cache in publishing workflows. |



Description
Context
This PR updates our GitHub Actions workflows to use artifacts instead of caching for better control over build outputs. The changes affect the
lint-build-test.ymlandpublish-release.ymlworkflows.Changes
cache: yarnconfigurations from all Node.js setup steps inlint-build-test.ymlpublish-release.ymlworkflow to:checkout@v4,setup-node@v4)upload-artifact@v4anddownload-artifact@v4Implementation Details
This change replaces the GitHub Actions caching mechanism with artifacts for managing build outputs between jobs. This provides more explicit control over how build artifacts are handled and transferred throughout the workflow.
Performance Considerations
Build times may slightly increase without caching, but the artifact implementation ensures efficient transfer of build outputs between jobs. We can monitor and optimize if needed.
Breaking Changes
None. This is an internal workflow change that doesn't affect the published packages or their consumers.
Testing Instructions
Related Issues
#3925 - Remove usage of GitHub action caching from critical workflows