Summary
The nnU-Net GitHub Issue Triage workflow embeds untrusted issue titles and bodies directly into the prompt for a command-capable AI agent.
Any GitHub user who opens an issue can influence this agent to perform unintended authenticated actions on the repository's issues, such as changing labels or posting comments, whenever the workflow automatically triggers on issue creation.
Affected context
This vulnerability arises in the nnU-Net repository's GitHub Actions automation used for issue triage.
The affected workflow:
- Is defined in
.github/workflows/issue-triage.yml - Uses
allowed_non_write_users: ${{ github.event.issue.user.login }}to admit any issue creator into the agentic workflow - Embeds raw issue title and body into prompts for
anthropics/claude-code-action - Grants the AI agent permission to run
ghcommands that can comment on and relabel issues
The risk exists whenever untrusted GitHub issues can trigger this workflow without additional safeguards or prompt isolation.
Exploit preconditions
- Attack surface: Public GitHub repository issue tracker with automated triage workflows.
- Required access: Ability to open an issue on the nnU-Net repository (any logged-in GitHub user, if issues are public).
- Trigger point: The
issues.openedevent, which automatically starts the Issue Triage workflow for newly created issues. - Why exploitation is possible:
- The workflow uses
allowed_non_write_users: ${{ github.event.issue.user.login }}, effectively trusting the reporter as an allowed non-write user. - Issue title and body are injected directly into the AI agent's prompt without sanitization or strict instruction isolation.
- The AI agent is command-capable and authorized to execute
ghoperations that can modify issue metadata and comments.
Why this happens
The core problem is a prompt injection / output manipulation scenario where untrusted user input is treated as trusted control material inside an AI agent's prompt.
By interpolating issue titles and bodies directly into the prompt for anthropics/claude-code-action, the workflow allows attacker-controlled text to override or subvert the intended system instructions, steering the agent's behavior.
This maps to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because untrusted content is emitted into a prompt that drives a downstream component (the AI agent plus gh CLI) with authenticated capabilities.
The broader bug class is unsafe agentic orchestration: an AI agent with elevated permissions is given both high trust and high agency, but its input channel (GitHub issues) is fully attacker-controlled and not constrained through robust guardrails, role separation, or strict output policies.
Potential impact
- The AI agent may relabel issues in attacker-chosen ways, distorting triage workflows and automation signals.
- The AI agent may post misleading, abusive, or spam comments on issues under the project's name, harming project reputation.
- The AI agent may close, reopen, or otherwise manage issue states if such commands are available through its
ghintegration. - The workflow may create a precedent for further misuse of AI agents with repository-scoped permissions, increasing the risk of future automation abuse.
General mitigation guidance
Mitigation generally focuses on reducing both the trust placed in AI-generated actions and the direct influence of untrusted content on agent instructions:
- Constrain AI agent capabilities:
- Limit the agent to read-only analysis where possible, and separate analysis from actions.
- Route all actions that affect repository state through explicit human review or approval steps.
- Restrict
ghcommand usage in workflows to a tightly scoped subset of operations.
- Isolate and sanitize untrusted input:
- Treat issue content as data, not instructions—present it in clearly delimited sections within prompts to reduce prompt injection influence.
- Avoid interpolating untrusted text into parts of the prompt that define goals, policies, or command sequences.
- Apply neutralization patterns (e.g., quoting, markdown fencing) around user-provided content before including it in prompts.
- Separate roles and contexts:
- Use distinct prompt roles (system vs. user vs. tools) and ensure user content cannot modify system-level instructions.
- Introduce an intermediate step where AI suggestions are rendered as proposed actions rather than executed commands.
- Align privileges with risk:
- Run AI-powered workflows under machine accounts with minimal required permissions.
- Disable or restrict automatic triggering of powerful agentic workflows on public issue events, or gate them behind project-maintainer actions.
How teams detect issues like this
Detection should focus on both configuration-level review and behavioral monitoring of AI-driven automations:
- Configuration and code review:
- Review GitHub Actions workflows for:
- Direct interpolation of
github.event.*fields into AI prompts. - Use of command-capable AI actions coupled with
ghor other CLIs authorized to modify repository state. allowed_non_write_usersor similar settings that effectively grant external users access to agentic workflows.- Flag workflows where untrusted content is written into prompts, scripts, or configuration used by powerful tools.
- Static analysis and policy checks:
- Introduce CI policies that treat AI-agent actions as sensitive, requiring:
- No direct use of untrusted input in system instructions.
- Explicit allowlists for commands an AI agent may invoke.
- Use static analysis or rule-based scanners to identify patterns where user-generated content is passed directly into AI tools with elevated privileges.
- Runtime and audit monitoring:
- Monitor repository audit logs and issue histories for unusual patterns:
- Sudden relabeling or commenting behaviors following AI workflow runs.
- Repeated, similar comments or label changes triggered by new issues from unknown users.
- Introduce alerting when AI workflows execute commands that modify issues, especially on public repositories.
- Automated review tooling:
- Employ automated workflow linters or security scanners designed to inspect CI/CD configurations for prompt injection and unsafe AI usage patterns.

