Skip to content

feature-ideation: model with Discussion-write token can bypass dry_run and the target-Discussion guard via its Bash tool #1389

Closed

Description

@don-petry

CodeRabbit reported 2 findings with the same root cause; filed as one issue.

.github/scripts/feature-ideation/discussion-mutations.sh:39

Preview analysis retains Discussion write credentials, while its mutation guard depends on environment state that model-generated shell commands can change. Contributor text that redirects tool use can therefore cause writes despite the initiating caller selecting dry_run.

Location: .github/scripts/feature-ideation/discussion-mutations.sh:39
Severity: low · Rule: llm_security · Reachability: external
Subsystem: Event-driven automation and agents

The preview policy is enforced inside the same shell environment whose commands the model selects. Untrusted Discussion content can influence a model that retains Discussion-write credentials and can change the dry-run flag, allowing publication despite the caller's explicit preview setting.

Evidence

  • Source/control: Contributor-controlled issue and Discussion titles collected into signals.json and read by the model.
  • Sink/decision: Authenticated Discussion creation at lines 80-84; comment and label mutations have the same mutable preview guard.
  • Missing mitigation: The caller's preview setting is not enforced outside model-controlled execution, and preview analysis retains credentials capable of performing the forbidden writes.

Assumptions
Based on these assumptions: A4 (Third-party behavior): Claude Code's allowedTools setting permits model-selected Bash commands to execute with the step's environment, including GH_TOKEN and DRY_RUN, as documented.
Findings that rely on assumptions are published at medium severity at most. If an assumption does not hold for your deployment, dismiss this finding.

Reachability call stack
  1. .github/scripts/feature-ideation/collect-signals.sh:99 — collect contributor titles
  2. .github/scripts/feature-ideation/lib/compose-signals.sh:61 — compose signals
  3. .github/scripts/feature-ideation/validate-signals.py:170 — validate structure
  4. .github/workflows/feature-ideation-reusable.yml:414 — instruct model to read signals
  5. .github/workflows/feature-ideation-reusable.yml:306 — allow Bash execution
  6. .github/scripts/feature-ideation/discussion-mutations.sh:39 — consult mutable preview setting
  7. .github/scripts/feature-ideation/discussion-mutations.sh:80 — create mutation sink
  8. .github/scripts/feature-ideation/discussion-mutations.sh:119 — comment mutation sibling sink
  9. .github/scripts/feature-ideation/discussion-mutations.sh:165 — label mutation sibling sink
  10. .github/workflows/feature-ideation-reusable.yml:78 — accept the caller's dry-run policy
  11. .github/workflows/feature-ideation-reusable.yml:359 — analyst reads untrusted Discussion content
  12. .github/workflows/feature-ideation-reusable.yml:306 — authorize unrestricted Bash tool calls
  13. .github/scripts/feature-ideation/discussion-mutations.sh:95 — evaluate mutable dry-run state
  14. .github/scripts/feature-ideation/discussion-mutations.sh:119 — submit Discussion comment mutation
  15. .github/scripts/feature-ideation/lib/gh-safe.sh:125 — execute authenticated GitHub request

.github/scripts/feature-ideation/discussion-mutations.sh:119

Single-idea analysis reads contributor-authored Discussion content while retaining repository-wide Discussion mutation authority. Its executor accepts model-selected targets without enforcing the initiating Discussion, allowing redirected tool use to publish bot-authored comments outside the caller's selected target.

Location: .github/scripts/feature-ideation/discussion-mutations.sh:119
Severity: low · Rule: llm_security · Reachability: external
Subsystem: Event-driven automation and agents

Evidence

  • Source/control: The title, body, and existing comments of a human-created Ideas Discussion read during single-idea enhancement.
  • Sink/decision: comment_on_discussion forwards its model-selected discussion ID and body to an authenticated GraphQL mutation.
  • Missing mitigation: No executor independently verifies that a mutation targets the Discussion selected by the initiating workflow. The analysis process can also bypass the helper using its repository-scoped write credential.

Assumptions
Based on these assumptions: A4 (Third-party behavior): Claude Code's allowedTools setting permits model-selected Bash commands to execute with the step's GH_TOKEN, as documented.
Findings that rely on assumptions are published at medium severity at most. If an assumption does not hold for your deployment, dismiss this finding.

Reachability call stack
  1. .github/workflows/feature-ideation.yml:80 — human-created discussion event
  2. .github/workflows/feature-ideation.yml:122 — redispatch with target_discussion
  3. .github/workflows/feature-ideation.yml:185 — invoke reusable workflow with resolved target
  4. .github/workflows/feature-ideation-reusable.yml:359 — model reads target discussion body and comments
  5. .github/scripts/feature-ideation/collect-signals.sh:99 — alternative scheduled source: contributor titles enter collection
  6. .github/scripts/feature-ideation/collect-signals.sh:214 — compose signals and write the artifact input
  7. .github/workflows/feature-ideation-reusable.yml:193 — upload signals for the analysis job
  8. .github/workflows/feature-ideation-reusable.yml:233 — download signals into the analysis job
  9. .github/workflows/feature-ideation-reusable.yml:414 — model reads collected signals
  10. .github/workflows/feature-ideation-reusable.yml:281 — Claude action executes model-selected Bash with discussion-write credentials
  11. .github/scripts/feature-ideation/discussion-mutations.sh:119 — comment_on_discussion sends selected mutation arguments
  12. .github/scripts/feature-ideation/lib/gh-safe.sh:125 — authenticated GraphQL request [sink]

Filed from a CodeRabbit security scan (scan 2d23b5ee-606a-403f-b407-81ddebdb0115, revision 1ea9ee1fbecc). Finding IDs: ce39501f-1014-40ae-afe9-2b54c0d23ba8, b3d5e096-6638-4b08-92cd-4deec4be8ac9. CodeRabbit notes that findings relying on its stated assumptions are capped at medium severity; dismiss if an assumption does not hold.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in-progressAn agent is actively working this issuesecuritySecurity-related PRs and issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions