Skip to content

ci: fix event payload code injection - #459

Merged
LargeModGames merged 1 commit into
mainfrom
ci/fix-event-injection
Aug 14, 2026
Merged

LargeModGames merged 1 commit into
mainfrom
ci/fix-event-injection

Conversation

@LargeModGames

@LargeModGames LargeModGames commented Aug 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes CodeQL alert (actions/cache-poisoning/code-injection, High): the prepare job templated ${{ toJson(github.event) }} directly into its run: script. Expression expansion happens before the shell executes, so the quoted heredoc offered no protection - a PR title/body or a commit message containing a MESSAGE line followed by shell commands would escape the heredoc and run, and on the push trigger 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_NAME and cat "$GITHUB_EVENT_PATH". No other workflow interpolates event fields into a script (nix.yml and the if: guards are expression contexts; triage.yml already goes through env:).

Testing

  • Workflow-only change; the edited prepare job runs on this PR itself and prints the same event dump.

Additional notes

  • The pre-existing actions/checkout@master refs in this file are a separate hygiene pass.

💬 Questions or want to chat with other contributors? Join the spotatui Discord.

Summary by CodeRabbit

  • Chores
    • Improved CI workflow logging by including the event name and raw event details.
    • Simplified event information output for clearer troubleshooting.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 80750091-d9e2-44ac-aaa7-93ccfb929cc9

📥 Commits

Reviewing files that changed from the base of the PR and between 4badcd9 and c26eb7f.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

📝 Walkthrough

Walkthrough

The CI prepare job now logs the event name from $GITHUB_EVENT_NAME and the raw event payload from $GITHUB_EVENT_PATH. It removes heredoc-based templated JSON output.

Changes

CI event logging

Layer / File(s) Summary
Prepare job event logging
.github/workflows/ci.yml
The job reads event details directly from GitHub environment variables and the event payload file instead of interpolating event JSON in a workflow expression.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to c26eb

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)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the valid ci: prefix and clearly describes the event payload code injection fix.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/fix-event-injection
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch ci/fix-event-injection

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LargeModGames
LargeModGames merged commit 6311544 into main Aug 14, 2026
25 checks passed
@LargeModGames
LargeModGames deleted the ci/fix-event-injection branch August 14, 2026 07:29
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