Repository navigation
ci: fix event payload code injection - #459
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe CI ChangesCI event logging
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change moves event-payload debug output away from direct shell interpolation, reducing code-injection exposure without evidence of a functional regression; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Summary
Fixes CodeQL alert (
actions/cache-poisoning/code-injection, High): thepreparejob templated${{ toJson(github.event) }}directly into itsrun:script. Expression expansion happens before the shell executes, so the quoted heredoc offered no protection - a PR title/body or a commit message containing aMESSAGEline followed by shell commands would escape the heredoc and run, and on thepushtrigger that runs in main's scope with write access to the Actions cache other workflows restore.The step is debug output only, so it now reads the same payload as data:
$GITHUB_EVENT_NAMEandcat "$GITHUB_EVENT_PATH". No other workflow interpolates event fields into a script (nix.ymland theif:guards are expression contexts;triage.ymlalready goes throughenv:).Testing
preparejob runs on this PR itself and prints the same event dump.Additional notes
actions/checkout@masterrefs in this file are a separate hygiene pass.💬 Questions or want to chat with other contributors? Join the spotatui Discord.
Summary by CodeRabbit