docs(rules): flag GitHub Actions template injection in agent rules (EXSC-578)#2062
Conversation
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds a GitHub Actions security rule covering direct expression interpolation in ChangesGitHub Actions security guidance
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/rules/500-github-actions.md:
- Line 43: Update the safety guidance in the Fix bullet to limit the claim to
contexts outside the direct run: injection sink. Clarify that if: cannot
reference secrets directly, while with: and env: are safe only when the
receiving action or shell treats their values as data; retain the recommendation
to bind values through env: and quote the shell variable in run:.
- Around line 47-52: Update the “Check for authorized actor” example to replace
the reserved GITHUB_ACTOR environment variable with a custom name such as
ACTOR_NAME, and use that same name in the shell condition while preserving the
github.actor expression binding.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4e58affe-7524-4e45-946c-33af796f6320
📒 Files selected for processing (1)
.agents/rules/500-github-actions.md
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/rules/500-github-actions.md:
- Around line 47-51: Add shell: bash to the “Check for authorized actor” step so
its [[ ... ]] conditional executes consistently on all runners, including
Windows; keep the existing authorization logic unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 03653e6c-9ee2-4ffb-8dc3-024870b1c3cd
📒 Files selected for processing (1)
.agents/rules/500-github-actions.md
Which Linear task belongs to this PR?
Ref EXSC-578
Partial — this PR delivers the "add an AI-rule to catch it" half of EXSC-578 (the
Refkeyword intentionally does not auto-close the ticket, since the PR #1984 review/merge half is tracked separately).Why did I implement it this way?
Follow-up to PR #1984, which fixed the last direct
${{ github.* }}interpolations insiderun:scripts inprotectAuditLabels.yml. To stop this class of GitHub Actions template-injection bug from being reintroduced, this adds a[CONV:ACTIONS-NO-INJECTION]convention to the existing500-github-actions.mdrule rather than a new rule file — that rule is already scoped to.github/workflows/**, so the guidance activates exactly when an agent edits a workflow (satisfying both of the ticket's AI-rule checkboxes). The convention states the rule (never interpolate untrusted${{ ... }}into arun:body), names the highest-risk attacker-controllable contexts (github.actor,github.head_ref, everygithub.event.*field), gives the correctenv:-binding pattern plus the forbidden anti-pattern mirroring the #1984 fix, and clarifies that interpolation insideif:/with:/env:is safe — only therun:script body is the injection sink.Checklist before requesting a review
Checklist for reviewer (DO NOT DEPLOY and contracts BEFORE CHECKING THIS!!!)