feat: extend FG-001 pwn-request detection to issue_comment ChatOps#25
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CheckPwnRequest(FG-001) only analyzedpull_request_target, soissue_commentslash-command bots went entirely undetected — a/test-style comment that runsgh 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 targetedissue_commenthunt.Changes
issue_commentin addition topull_request_target.detectRunForkCheckoutalready catchesgh pr checkout, so the run-based idiom is covered.refs/pull/${{ github.event.issue.number }}/headinrefPointsToPRHead.author_associationgates (the standard ChatOps control —== MEMBER/OWNER/COLLABORATORor thecontains(fromJSON([...]))allowlist) as a mitigation → downgrade by 2. Ungated ChatOps stays elevated.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 ungatedgh pr checkoutChatOps (previously invisible), the rest correctly downgraded.juicedata/juicefs(base checkout, no PR ref) andPauseAI/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