Skip to content

feat: extend FG-001 pwn-request detection to issue_comment ChatOps#25

Merged
north-echo merged 1 commit into
mainfrom
feat/fg001-issue-comment
Jul 17, 2026
Merged

feat: extend FG-001 pwn-request detection to issue_comment ChatOps#25
north-echo merged 1 commit into
mainfrom
feat/fg001-issue-comment

Conversation

@north-echo

Copy link
Copy Markdown
Owner

Summary

CheckPwnRequest (FG-001) only analyzed pull_request_target, so issue_comment slash-command bots went entirely undetected — a /test-style comment that runs gh pr checkout ${{ github.event.issue.number }} and executes the PR code in the base-repo context with secrets is the same pwn class, and the scanner was blind to it. Surfaced by the targeted issue_comment hunt.

Changes

  • Analyze issue_comment in addition to pull_request_target. detectRunForkCheckout already catches gh pr checkout, so the run-based idiom is covered.
  • Recognize the checkout-ref idiom refs/pull/${{ github.event.issue.number }}/head in refPointsToPRHead.
  • Credit author_association gates (the standard ChatOps control — == MEMBER/OWNER/COLLABORATOR or the contains(fromJSON([...])) allowlist) as a mitigation → downgrade by 2. Ungated ChatOps stays elevated.
  • Trigger-aware finding message/details.

Validation (issue_comment hunt corpus, 108 repos)

The extension adds only 5 FG-001 findings — 2 critical + 1 high on Tencent/tdesign-mobile-vue's ungated gh pr checkout ChatOps (previously invisible), the rest correctly downgraded. juicedata/juicefs (base checkout, no PR ref) and PauseAI/pauseai-website (author-gated) are not flagged. Precise, not noisy.

Fixtures + tests: ungated issue_comment ChatOps → critical; author-gated → downgraded + mitigated. Full suite, gofmt, vet, self-scan clean.

🤖 Generated with Claude Code

CheckPwnRequest only analyzed pull_request_target, so issue_comment
slash-command bots — a comment like `/test` that does
`gh pr checkout ${{ github.event.issue.number }}` and runs the PR code
in the base context with secrets — went entirely undetected.

- Analyze issue_comment (in addition to pull_request_target). The
  existing detectRunForkCheckout already catches `gh pr checkout`.
- Recognize the issue_comment checkout ref idiom
  (refs/pull/${{ github.event.issue.number }}/head) in refPointsToPRHead.
- Credit author_association gates (MEMBER/OWNER/COLLABORATOR allowlist or
  contains(fromJSON([...]))), the standard ChatOps control, as a
  mitigation → downgrade by 2. Ungated ChatOps stays elevated.
- Trigger-aware finding message/details.

Validated on the issue_comment hunt corpus (108 repos): the extension
adds only 5 FG-001 findings — 2 critical + 1 high on Tencent/tdesign-
mobile-vue's ungated `gh pr checkout` ChatOps (previously invisible),
the rest correctly downgraded. juicefs (base checkout) and PauseAI
(author-gated github-script) are not flagged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@north-echo
north-echo merged commit af21059 into main Jul 17, 2026
1 check passed
@north-echo
north-echo deleted the feat/fg001-issue-comment branch July 17, 2026 15:30
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