Repository navigation
Description
dangerous-triggers currently flags pull_request_target and workflow_run because they run in the context of the base repository. The issue_comment trigger shares this property but is not flagged.
When a workflow triggers on issue_comment:
- It runs in the context of the base repository, not the fork
- It has access to repository secrets (including those not exposed to
pull_requestworkflows) GITHUB_TOKENhas the repository's default permissions (often includingcontents: write)- On public repos, any user who can comment on issues/PRs can trigger the workflow — even users with zero repository permissions
This makes issue_comment fundamentally similar to pull_request_target in terms of security posture. All three recent AI agent attack disclosures rely on it:
- Claude Code Action RCE —
issue_commenttrigger for Claude Code - PromptPwnd —
issuesandissue_commenttriggers for multiple AI agents - A real-world bounty report where
issue_commenttriggered a review agent that checked out PR code and executed an attacker-controllednpxbinary
Beyond AI agents, issue_comment is dangerous for any workflow that:
- Checks out PR code referenced from the comment context
- Runs commands based on comment content
- Has write permissions to the repository
Nuance on severity
issue_comment is more commonly used legitimately than pull_request_target — chatops, bot commands, triage automation. This means we need to think about noise.
Some options:
- Flag at Medium severity, Medium confidence (lower than
pull_request_target's High/Medium), Regular persona - Flag at High severity, Medium confidence, Pedantic persona (only shown to users who opt in)
- Flag only when combined with other risk signals (e.g., checkout steps,
run:blocks, broad permissions) — but this adds complexity
I'd lean toward option 1: Medium/Medium, Regular persona. It's still an important signal but acknowledges that issue_comment has more legitimate uses.
Proposed change
Add a check to DangerousTriggers::audit_workflow. This likely requires adding a has_issue_comment() method to the Workflow model (similar to the existing has_pull_request_target() and has_workflow_run()).
The finding message could be something like: "issue_comment trigger runs in the base repository context with access to secrets"
Remediation guidance
- Restrict who can trigger the workflow using
if: github.event.comment.author_association == 'MEMBER'or similar conditions - Use minimal permissions (
permissions: {}at workflow level, explicit per-job) - Consider whether
pull_request(which runs in the fork context) would suffice - Never check out and execute PR code in an
issue_comment-triggered workflow - Be aware that
GITHUB_TOKENinissue_commentworkflows may have broader access than inpull_requestworkflows
Related
- Audit idea: TOCTOU PR/branch checks #935 — TOCTOU;
issue_commentworkflows that reference PR branches are susceptible to race conditions - New audit:
agentic-actions— detect insecure AI coding agent configurations #1605 — The proposedagentic-actionsaudit would specifically flag AI agents onissue_commenttriggers at higher severity
Activity
Flag issue_comment as a dangerous trigger
dguido commentedon Feb 12, 2026
PR: #1614
What was implemented:
issue_commentto thedangerous-triggersaudit at Medium severity / Medium confidence (Regular persona)has_issue_comment()to the Workflow model following the existinghas_pull_request_target()/has_workflow_run()patterndangerous_triggersintegration test module with 7 tests covering all trigger variants (bare event, bare events list, events with body, combined triggers, and safe workflow)Key design decisions:
issue_commenthas more legitimate uses thanpull_request_targetorworkflow_run.persona()call needed)