Repository navigation
feat: implement issue #1872 — Harden the issue-comment trust filter: a missing author_association defaults to OWNER, the one fail-open in a trust boundary - #2021
Conversation
…a missing author_association defaults to OWNER, the one fail-open in a trust boundary
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
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.
Code Review
This pull request enhances the security of the GitHub issue comment trust filter by failing closed when the 'author_association' field is missing, null, or empty. It also sanitizes control characters in user logins to prevent forgery of kept comments and logs dropped comments to STDERR. Unit tests have been updated and expanded to verify these changes. Feedback on the changes suggests appending '|| [ -n "$tag" ]' to the 'read' loop condition in the shell script to ensure the final line of input is processed correctly even if it lacks a trailing newline.
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Dev-Lead — review-changes (applied)Changes committed and pushed. Requested items addressed:
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-02T14:36:22Z. |
Superseded by automated re-review at
|
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: e9516b324a74eb4741d7c60e21f71dd48d03d45c
Cascade: triage → deep+duck (triage: haiku 4.5 [sonnet 5.5, sonnet 5] → deep: opus 5.5 [opus 4.8, sonnet 5.5] + duck: gemini-3.8-flash [sonnet 5.5] → audit: opus 5.5 [opus 4.8, opus 4.7])
Summary
Both reviewers agree on MEDIUM risk and approve: the issue-comment trust filter now fails closed on missing author_association, and control characters are stripped from logged fields so K lines cannot be forged. Both independently flagged the untested no-trailing-newline path (|| [ -n "$tag" ]) at scripts/lib/issue-comments.sh:78, but under different category labels, so the findings are kept separate at their original severities; it is defensive-only and non-blocking. The rubber duck alone noted that IFS tab-splitting collapses consecutive tabs in drop log lines, a cosmetic issue.
Cross-engine agreement
full
Findings
- info: Fail-open default removed: missing/null/empty author_association now routes to an explicit drop record; only OWNER/MEMBER/COLLABORATOR are kept. Strict tightening. (
scripts/lib/issue-comments.sh:63) - info: Record-forging surface checked: kept payloads are base64, drop records strip control chars from login and association, and the stderr prefix cannot start a workflow command. (
scripts/lib/issue-comments.sh:66) - info: The only production caller uses the REST endpoint, which always includes author_association, so trusted comments are unaffected. A future GraphQL switch (camelCase authorAssociation) would visibly drop all comments, which is the intended fail-closed behavior. (
scripts/dev-lead-fix-issue.sh:572) - minor: Cubic P3 advisory: no test exercises the
|| [ -n "$tag" ]final-record-without-trailing-newline guard. jq always newline-terminates, so it is unreachable today. Non-blocking. (scripts/lib/issue-comments.sh:78) - info: No direct test for the final-record-without-trailing-newline path; defensive only since jq always emits a trailing newline. (
scripts/lib/issue-comments.sh:78) - info: IFS=$'\t' read collapses consecutive tabs, so an empty login would shift fields in D log lines. Cosmetic only: login defaults to 'unknown', and K records carry base64 with no tabs. (
scripts/lib/issue-comments.sh:78) - info: MCP run_secret_scanning was unavailable, so no MCP scan ran. The gitleaks CI check passed and the diff has no credentials.
Reviewed by the PR-review cascade (triage: haiku 4.5 [sonnet 5.5, sonnet 5] → deep: opus 5.5 [opus 4.8, sonnet 5.5] + duck: gemini-3.8-flash [sonnet 5.5] → audit: opus 5.5 [opus 4.8, opus 4.7]). Reply if you need a human review.
Dismissing approval due to a PR issue comment lacking a verified disposition (#1813)
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-02T14:50:25Z. |
Review — fix requested (cycle 3/3)The automated review identified the following issues. Please address each one: Findings to fixAutomated review — NEEDS HUMAN REVIEWRisk: MEDIUM SummaryFails the dev-lead issue-comment trust filter closed (#1872). A missing, null, or empty author_association is now untrusted and dropped instead of defaulting to OWNER. Every trust drop is logged to stderr, and the log tells a missing association apart from an untrusted one. The code is correct and all of #1872's acceptance criteria are met. The one blocker is CI: about 30 required checks, including Lint, bats, ShellCheck and unit, are still queued or running on this commit, so it cannot be approved yet. Linked issue analysisCloses #1872. All four acceptance criteria are met:
FindingsIncremental since Manual checks on
Non-blocking (existing behaviour, not caused by this PR): on the kept path, No blocking code findings. CI statusNot yet green. Completed checks pass: CodeQL, SonarCloud (quality gate passed), gitleaks, AgentShield, shellcheck, unit-tests, holdout-guard and others. Still QUEUED or IN_PROGRESS on
Approval requires all checks to pass. Re-review once they finish; if they come back green this should be approvable as-is. Reviewed automatically by the PR-review agent (single-reviewer mode: opus 5.5 [opus 4.8, opus 4.7]). Reply if you need a human review. Additional tasks
The review cascade will automatically re-review after new commits are pushed. |
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Dev-Lead — fix-reviews (applied)Changes committed and pushed. Requested items addressed:
|
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 30e0c665f9b47e9a5d4a16dc0cf5d9f3ff8be5e1
Cascade: triage → deep+duck (triage: haiku 4.5 [sonnet 5.5, sonnet 5] → deep: opus 5.5 [opus 4.8, sonnet 5.5] + duck: gemini-3.8-flash [sonnet 5.5] → audit: opus 5.5 [opus 4.8, opus 4.7])
Summary
Both reviewers agree on MEDIUM risk and approve: the trust filter now fails closed on missing, null or empty author_association, and control characters in logged fields are neutralised. Both engines converged on the GNU-only base64 -d in the no-trailing-newline test; this is raised to major by the cross-engine rule, but CI runs on Linux and the newer head 34040e0 already adds a base64 -D fallback. The empty-login log-field collapse was flagged by both as cosmetic only, with no effect on trust decisions. The head-drift note is unique to the deep reviewer, and the rubber duck found nothing unique.
Cross-engine agreement
full
Findings
- major: {"severity":"major","category":"test-portability","message":"The 'final record without a trailing newline' test decodes with GNU-only
base64 -d; other tests use a portable fallback. CI runs on Linux, and the newer head 34040e0 adds abase64 -Dfallback (test-only change).","file":"tests/dev-lead/unit/test_issue_comments.bats","line":268,"sources":["deep","rubber-duck"]} - info: {"severity":"info","category":"logging","message":"If a login is empty, the tab separators collapse under IFS=tab
read, so the drop log line loses or shifts fields. The comment is still dropped, so trust is unaffected.","file":"scripts/lib/issue-comments.sh","line":78,"sources":["deep"]} - info: {"severity":"info","category":"logging","message":"The drop-log
readuses IFS=tab, which collapses adjacent tabs, so an empty login would shift the fields in the stderr log line. This is cosmetic, because K lines carry base64 only.","file":"scripts/lib/issue-comments.sh","line":80,"sources":["rubber-duck"]} - info: {"severity":"info","category":"head-drift","message":"The PR head moved from the reviewed SHA 30e0c66 to 34040e0 during the review. The only change is the test-only base64 fallback; scripts/lib/issue-comments.sh is unchanged.","file":null,"line":null,"sources":["deep"]}
Reviewed by the PR-review cascade (triage: haiku 4.5 [sonnet 5.5, sonnet 5] → deep: opus 5.5 [opus 4.8, sonnet 5.5] + duck: gemini-3.8-flash [sonnet 5.5] → audit: opus 5.5 [opus 4.8, opus 4.7]). Reply if you need a human review.
|
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-02T14:57:40Z. |



Problem
Harden the issue-comment trust filter: a missing author_association defaults to OWNER, the one fail-open in a trust boundary
From the issue: The issue-comment trust filter added by PR #1800 (for #1566) defaults a missing
author_associationtoOWNER— the most-trusted value — on a filter whose entire purpose is to decide whose comments may steer dev-lead's implementation.Risk
Low — changes automation shell logic under scripts/, covered by shellcheck (--severity=warning) and the bats suite.
Test plan
Tests added/updated:
tests/dev-lead/unit/test_fix_issue.bats,tests/dev-lead/unit/test_issue_comments.bats. Verification:bash scripts/dev-lead-lint.sh(shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.Rollback
Revert this PR. No non-revertible side effects (no tags, migrations, or external state).
Monitoring
This PR's Lint (shellcheck) and bats checks show pass/fail; watch subsequent dev-lead / pr-review runs for behavioral regressions.
Closes #1872