chore(ci): prevent cross-workflow cache poisoning in pr-preview (CVE-2026-45321 mitigation)#8423
Conversation
…che poisoning pr-preview and release workflows shared identical cache keys, allowing a malicious PR to poison caches that release builds restore from.
WalkthroughThe ChangesCI Cache Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Preview: https://pf-pr-8423.surge.sh A11y report: https://pf-pr-8423-a11y.surge.sh |
|
🎉 This PR is included in version 6.5.0-prerelease.94 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
pr-preview.ymlcache keys to prevent cross-workflow cache poisoning withrelease.ymlBackground
On May 11, 2026, the Mini Shai-Hulud worm (CVE-2026-45321, CVSS 9.6) compromised 84 npm package artifacts across 42
@tanstack/*packages by chaining:pull_request_targettrigger that runs fork code with base repo privilegesactions/cachekeys across PR and release workflows, allowing malicious cache entries from PR builds to be restored in release buildsThis repo's
pr-preview.ymlis susceptible to vectors 1 and 2. This PR addresses vector 2.What changed
pr-preview.ymlandrelease.ymlshared identical cache keys:A malicious PR could poison the yarn or webpack cache, which would then be restored by
release.ymlduring the next production build — injecting attacker-controlled code into published packages.Fix: Added
pr-prefix to all cache keys inpr-preview.yml:Remaining risk (follow-up needed)
pr-preview.ymlstill usespull_request_targetand checks out fork PR code (lines 15-16), exposingSURGE_TOKEN,SURGE_LOGIN, andGH_PR_TOKENto attacker-controlled code. Fixing this requires splitting into two workflows (pull_requestbuild +workflow_rundeploy)References
Test plan
pr-preview.ymlandrelease.ymlhave no overlapping cache key prefixesSummary by CodeRabbit