Repository navigation
Description
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
- .github/scripts/feature-ideation/collect-signals.sh:99 — collect contributor titles
- .github/scripts/feature-ideation/lib/compose-signals.sh:61 — compose signals
- .github/scripts/feature-ideation/validate-signals.py:170 — validate structure
- .github/workflows/feature-ideation-reusable.yml:414 — instruct model to read signals
- .github/workflows/feature-ideation-reusable.yml:306 — allow Bash execution
- .github/scripts/feature-ideation/discussion-mutations.sh:39 — consult mutable preview setting
- .github/scripts/feature-ideation/discussion-mutations.sh:80 — create mutation sink
- .github/scripts/feature-ideation/discussion-mutations.sh:119 — comment mutation sibling sink
- .github/scripts/feature-ideation/discussion-mutations.sh:165 — label mutation sibling sink
- .github/workflows/feature-ideation-reusable.yml:78 — accept the caller's dry-run policy
- .github/workflows/feature-ideation-reusable.yml:359 — analyst reads untrusted Discussion content
- .github/workflows/feature-ideation-reusable.yml:306 — authorize unrestricted Bash tool calls
- .github/scripts/feature-ideation/discussion-mutations.sh:95 — evaluate mutable dry-run state
- .github/scripts/feature-ideation/discussion-mutations.sh:119 — submit Discussion comment mutation
- .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
- .github/workflows/feature-ideation.yml:80 — human-created discussion event
- .github/workflows/feature-ideation.yml:122 — redispatch with target_discussion
- .github/workflows/feature-ideation.yml:185 — invoke reusable workflow with resolved target
- .github/workflows/feature-ideation-reusable.yml:359 — model reads target discussion body and comments
- .github/scripts/feature-ideation/collect-signals.sh:99 — alternative scheduled source: contributor titles enter collection
- .github/scripts/feature-ideation/collect-signals.sh:214 — compose signals and write the artifact input
- .github/workflows/feature-ideation-reusable.yml:193 — upload signals for the analysis job
- .github/workflows/feature-ideation-reusable.yml:233 — download signals into the analysis job
- .github/workflows/feature-ideation-reusable.yml:414 — model reads collected signals
- .github/workflows/feature-ideation-reusable.yml:281 — Claude action executes model-selected Bash with discussion-write credentials
- .github/scripts/feature-ideation/discussion-mutations.sh:119 — comment_on_discussion sends selected mutation arguments
- .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.
Activity
fix(security): bind feature-ideation publish to the Ideas category an…
test(feature-ideation): make the publish-boundary negated assertions …
fix(feature-ideation): pin the label, cap and quiet published text, m…
fix(feature-ideation): harden publish lookups and field checks (#1389)
fix(feature-ideation): honour re-run markers only on the publish toke…
fix(feature-ideation): fail loudly when the publish token is not repo…
fix(security): keep Discussion writes out of the feature-ideation mod…