codex - 💡(How to fix) Fix [Security] Potential agentic workflow injection risk in `.github/workflows/issue-labeler.yml` [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19977Fetched 2026-04-29 06:24:22
View on GitHub
Comments
2
Participants
2
Timeline
17
Reactions
0
Author
Timeline (top)
mentioned ×6subscribed ×5labeled ×3commented ×2

The issue-labeling workflow in .github/workflows/issue-labeler.yml appears to incorporate untrusted GitHub issue content directly into an agentic prompt processed by openai/codex-action. https://github.com/openai/codex/blob/fa127be25ff547c950240c4bfe6c100c394880b2/.github/workflows/issue-labeler.yml#L75-L79

And this workflow can be trigger by any non-write user. https://github.com/openai/codex/blob/fa127be25ff547c950240c4bfe6c100c394880b2/.github/workflows/issue-labeler.yml#L26

Since issue titles and bodies are attacker-controlled input, this creates a potential Agentic Workflow Injection risk: an external user may be able to steer the Codex agent away from its intended issue-labeling task and influence its behavior during the GitHub Actions run.

The workflow then consumes the model-generated output and applies labels through an authenticated GitHub CLI step. As a result, attacker-controlled issue content may influence downstream repository automation, including issue classification and label application.

Root Cause

The issue-labeling workflow in .github/workflows/issue-labeler.yml appears to incorporate untrusted GitHub issue content directly into an agentic prompt processed by openai/codex-action. https://github.com/openai/codex/blob/fa127be25ff547c950240c4bfe6c100c394880b2/.github/workflows/issue-labeler.yml#L75-L79

And this workflow can be trigger by any non-write user. https://github.com/openai/codex/blob/fa127be25ff547c950240c4bfe6c100c394880b2/.github/workflows/issue-labeler.yml#L26

Since issue titles and bodies are attacker-controlled input, this creates a potential Agentic Workflow Injection risk: an external user may be able to steer the Codex agent away from its intended issue-labeling task and influence its behavior during the GitHub Actions run.

The workflow then consumes the model-generated output and applies labels through an authenticated GitHub CLI step. As a result, attacker-controlled issue content may influence downstream repository automation, including issue classification and label application.

Fix Action

Fix / Workaround

Suggested Mitigations

Code Example

.github/workflows/issue-labeler.yml

---

gh issue view "$ISSUE_NUMBER" --json title,body,labels
RAW_BUFFERClick to expand / collapse

Hi OpenAI team,

I would like to report a potential security issue in the Codex repository's GitHub Actions workflow:

.github/workflows/issue-labeler.yml

I previously submitted this issue through Bugcrowd, but the submission was marked as out of scope. I still believe the issue represents a meaningful security risk, so I am reporting it here publicly through a GitHub Issue. For ethical reasons, I will not disclose a working PoC or detailed exploitation payload in this public issue. However, I believe the issue is relatively easy to understand and verify from the workflow design itself, and I would be happy to provide additional details privately if needed.

Summary

The issue-labeling workflow in .github/workflows/issue-labeler.yml appears to incorporate untrusted GitHub issue content directly into an agentic prompt processed by openai/codex-action. https://github.com/openai/codex/blob/fa127be25ff547c950240c4bfe6c100c394880b2/.github/workflows/issue-labeler.yml#L75-L79

And this workflow can be trigger by any non-write user. https://github.com/openai/codex/blob/fa127be25ff547c950240c4bfe6c100c394880b2/.github/workflows/issue-labeler.yml#L26

Since issue titles and bodies are attacker-controlled input, this creates a potential Agentic Workflow Injection risk: an external user may be able to steer the Codex agent away from its intended issue-labeling task and influence its behavior during the GitHub Actions run.

The workflow then consumes the model-generated output and applies labels through an authenticated GitHub CLI step. As a result, attacker-controlled issue content may influence downstream repository automation, including issue classification and label application.

Security Impact

This issue can let an external attacker influence the automated issue-labeling workflow through attacker-controlled issue content. The impact is mainly twofold:

  • Sandboxed code execution in the Codex action. The workflow places the issue title/body into the openai/codex-action prompt. In private testing, this allowed the issue content to steer Codex into executing commands inside its sandbox. While currently sandboxed, this is still a trust-boundary violation and could threaten the repository’s integrity if combined with a sandbox escape or runner-side weakness.

  • Incorrect labeling and possible DoS. The workflow applies Codex-generated labels using an authenticated gh issue edit step. Therefore, attacker-influenced output can cause incorrect labels. Since the workflow also runs on the codex-label label event, attacker-influenced labeling may trigger repeated workflow runs or unnecessary resource consumption. https://github.com/openai/codex/blob/fa127be25ff547c950240c4bfe6c100c394880b2/.github/workflows/issue-labeler.yml#L13

Suggested Mitigations

A safer design is to avoid directly interpolating the issue title and body into the Codex prompt. Instead, the workflow can pass only the trusted issue number to Codex and instruct Codex to retrieve the issue content itself through GitHub CLI, for example:

gh issue view "$ISSUE_NUMBER" --json title,body,labels

Responsible Disclosure Note

I am intentionally not including the concrete PoC payload here. My goal is to report the design-level risk without enabling abuse.

If the maintainers would like to investigate further, I can provide more detailed reproduction information privately.

Thanks for taking a look. I believe this is an important class of risk for agentic CI/CD workflows, even when the immediate impact may appear limited under the current sandbox and permission model.

Credit

Security PRIDE Research Group @security-pride

extent analysis

TL;DR

Avoid directly interpolating untrusted issue content into the Codex prompt to mitigate the Agentic Workflow Injection risk.

Guidance

  • Review the .github/workflows/issue-labeler.yml workflow to identify potential instances of untrusted input being used in the Codex prompt.
  • Consider passing only the trusted issue number to Codex and instructing it to retrieve the issue content itself through GitHub CLI, as suggested in the issue.
  • Verify that the workflow is properly sanitized to prevent attacker-controlled input from influencing the automated issue-labeling workflow.
  • Investigate the use of authenticated GitHub CLI steps to apply labels and ensure that they are not vulnerable to incorrect labeling or DoS attacks.

Example

gh issue view "$ISSUE_NUMBER" --json title,body,labels

This command can be used to retrieve issue content in a safer manner, without directly interpolating untrusted input into the Codex prompt.

Notes

The issue highlights the importance of properly sanitizing user input in CI/CD workflows, especially when using agentic actions like Codex. The suggested mitigation of passing only the trusted issue number to Codex and instructing it to retrieve the issue content itself through GitHub CLI can help reduce the risk of Agentic Workflow Injection.

Recommendation

Apply the suggested mitigation of passing only the trusted issue number to Codex and instructing it to retrieve the issue content itself through GitHub CLI to reduce the risk of Agentic Workflow Injection. This approach helps to avoid directly interpolating untrusted input into the Codex prompt, thereby mitigating the potential security risk.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING