# Backdooring the next release of Codex through Github Action Pipeline exploit chaining

Prompt injection in Codex's issue-labeler workflow led to sandbox escape, token theft, cache poisoning, and a backdoored release workflow in openai/codex CI.

- Payout: $1,000
- Severity: critical
- Program: OpenAI
- Found by: W0rty
- Disclosed: 2026-07-09
- Write-up quality: 8/10
- Original: https://bugcrowd.com/disclosures/3c0e5972-74ad-46a3-ab56-169db3d4c66f/backdooring-the-next-release-of-codex-through-github-action-pipeline-exploit-chaining
- Library page: https://bugbountylibrary.com/r/bc%3A56fdcd94-1cba-4d40-930e-a77b9edb673d
- Tags: area:ai domain:ai impact:integrity impact:rce kind:bounty platform:bugcrowd sev:critical tech:github-actions tech:llm technique:chained technique:source-review vuln:prompt-injection vuln:sandbox-escape vuln:secrets-leak

**Target:** GitHub Actions CI/CD pipeline (issue-labeler.yml, rust-ci.yml) and Codex agent sandbox
**Root cause:** Untrusted GitHub issue content was fed into the issue-labeler workflow allowing prompt injection into the Codex agent; the workspace-write sandbox leaked .NET CLR debug pipes in /tmp enabling memory reads of runner secrets.
**Steps:**
1. Open a GitHub issue containing attacker-controlled instructions targeting `issue-labeler.yml`
2. Prompt-inject the Codex agent to execute commands inside the sandbox
3. Enumerate `/tmp/` for .NET CLR debug pipes exposed by the runner
4. Attach to the debug pipe to read runner process memory and extract `ACTIONS_RUNTIME_TOKEN` and `GITHUB_TOKEN`
5. Use stolen token to poison the GitHub Actions cache
6. Pivot into `rust-ci.yml` via poisoned cache to gain `contents: write`
7. Plant a persistent backdoored workflow with `id-token: write`
**How found:** Team noticed the issue-labeler workflow consumed untrusted issue text into an LLM agent, hypothesized prompt injection; then inspected /tmp/ inside the sandbox and spotted .NET CLR debug pipes as an escape primitive.
**Exploitation:** Attacker submits a crafted issue; prompt injection drives the Codex agent to run commands; sandbox escape via .NET CLR debug pipes leaks runner tokens; cache poisoning pivots to a privileged workflow; a backdoored workflow with id-token:write is committed, enabling malicious npm releases under OpenAI's identity.
**Escalation:** Chained prompt injection -> sandbox escape -> token theft -> cache poisoning -> privileged workflow -> persistent backdoor with OIDC id-token:write, scaling to supply-chain compromise of ~10M weekly downloads.
**Insight:** LLM-driven CI workflows that ingest issue/PR text are prompt-injection sinks; check /tmp for runtime debug pipes (e.g. .NET CLR) inside agent sandboxes, and treat Actions cache as a cross-workflow privilege pivot.

