🌏 中文版
What happened
On November 11, security firm Depi published research disclosing a full exploit chain that starts with a prompt injection in a GitHub issue and ends with the ability to publish OpenAI's official npm package @openai/codex. The entry point was a GitHub Actions workflow in the openai/codex repository that reads newly opened issues to suggest labels. Because it was configured with allow-users: "*", anyone could open an issue and have its title and body fed straight into the Codex agent's prompt — the opening for a prompt injection. Depi used that opening to get code execution inside the agent's sandbox, then used an unauthenticated debug channel buried in the GitHub Actions runner to read a CI token out of process memory, and finally chained that into a separate known bug to obtain publishing credentials for a real release. Depi disclosed responsibly through Bugcrowd; OpenAI has patched the issue and paid an initial bounty. The entire chain was proven only in Depi's own test environment — no real users' package updates were affected.
Key facts
| Item | Value |
|---|---|
| Incident type | Prompt injection chained into a supply chain attack (CI/CD exploit chain) |
| Scope | openai/codex's issue-labeler workflow, the GitHub Actions runner, and the @openai/codex npm package (millions of downloads per month) |
| Severity | Critical (capable of a large-scale supply chain RCE in theory; caught before any real exploitation) |
| CVE | None (disclosed via Bugcrowd bug bounty, not formally numbered) |
| Sources | Depi research report, SecurityWeek, The Defiant |
Attack surface analysis
The chain has three stages, and each one rests on the same assumption: that an AI agent can be trusted as a component in the pipeline.
The first stage is the prompt injection itself. issue-labeler.yml feeds github.event.issue.title and github.event.issue.body directly into the Codex agent's prompt. The workflow treats that text as data, but the agent receives it in the same natural-language context as its trusted instructions, with no way to tell which parts are authorized instructions and which were written by a stranger. Depi found a prompt structure that made the model misread the issue content as a fresh set of system instructions, then compressed and encoded the shell script it wanted executed so Codex's own safety checks couldn't recognize its intent — getting arbitrary command execution inside the sandbox's workspace-write permission level.
The second stage is the sandbox escape. workspace-write mode disables network access, restricts writes to the current directory and /tmp/, and drops ptrace. But the two .NET processes behind a GitHub runner — Runner.Listener and Runner.Worker — create CoreCLR debug pipes under /tmp/, and on Linux, pipes are just files; opening them with open() isn't blocked by any of those restrictions. That debug protocol has no authentication at all: anyone who can open the pipe can issue a "read memory" command against Runner.Worker and pull secrets straight out of its process memory, including ACTIONS_RUNTIME_TOKEN and GITHUB_TOKEN — the sandbox strips environment variables from the child process, but it does nothing to protect its parent's memory.
The third stage is where it becomes a real supply chain attack. With no network access inside the sandbox, Depi exfiltrated the stolen tokens in chunks through the issue's own output log, then used them outside the sandbox. Because the token was still a valid OpenAI identity, it could be used to poison the GitHub Actions cache belonging to a separate workflow (rust-ci.yml) that held Actions: write permission — GitHub's cache is an unverified tar archive extracted without any content check, so a malicious file can land at an arbitrary path. The next time that workflow restored its cache, the planted file executed and abused its Actions: write permission to create a fake release. When a maintainer deleted that fake release, it triggered a separate, previously disclosed bug involving the release: delete action — discovered by security researcher Adnan Khan — that handed over an OpenID Connect token. With that token and write access, the attacker could request a signing JWT trusted by npm and publish a new version of @openai/codex.
- Anyone can open an issue to trigger the workflow (allow-users: "*")
- Prompt injection makes Codex run encoded code inside its sandbox
- An unauthenticated debug channel in /tmp leaks the CI token from Runner.Worker's memory
- The stolen token poisons the cache of another workflow with Actions:write permission
- Restoring the cache runs the planted file, abusing write access to create a fake release
- A maintainer deletes the fake release, triggering a known bug that yields an OIDC token
- The OIDC token buys an npm signing JWT — able to publish a malicious release, caught by OpenAI at this step
Simplified from Depi's November 11, 2026 research.
Mapped to the OWASP LLM Top 10: the starting point is LLM01 Prompt Injection; allow-users: "*" letting any untrusted outsider feed input to the agent maps to LLM06 Excessive Agency; and the end point is LLM05 Supply Chain Vulnerabilities — @openai/codex is an agent that runs code on developer machines with developer credentials, and turning on auto-update removes the human review step that would normally catch a bad release.
Defenses
Immediate actions
- Audit every GitHub Actions workflow that feeds externally-controlled text — issues, PR descriptions, comments — directly to an AI agent; if it's set to allow any outside trigger (like
allow-users: "*"), restrict it to trusted maintainers or org members - Give jobs that process outside text read-only tokens only, and never let them share a runner or cache with a workflow that holds cache-write, release, or publish permissions — those execution environments and credential scopes should be fully separated
- If you run Codex CLI or any auto-updating AI coding agent, consider a short cooldown before pulling freshly published updates, so the wider community has time to catch anything bad first
Long-term architecture
- Enforce least privilege on CI/CD tokens — audit which workflows genuinely need
writeorActions: write, and confirm that release-related events (likerelease: delete) can't unexpectedly trigger a path to a higher-privilege token - Treat GitHub Actions cache as untrusted input: verify provenance before restoring it, instead of extracting its contents unchecked
- Just as Depi's own "Upstream Security Platform" is what originally flagged this attack path, a tool focused on mapping AI agent attack surfaces — such as watchlist entry Zenity — can trace where a workflow's inputs ultimately lead in terms of privilege, before an agent gets wired into CI/CD, catching this kind of trigger-to-credential-to-publish chain before it's actually strung together
Impact
Depi fully validated the chain in a test environment but never carried out the final publishing step against the real openai/codex repository, and no malicious version was ever published to npm — no real user's Codex CLI update was affected. OpenAI patched the issue immediately after receiving the full proof of concept through Bugcrowd and has paid an initial bounty of $1,000, with the case still under further review (OpenAI's bounty policy caps out at $100,000 for critical findings). What's worth paying attention to is the scale: @openai/codex is downloaded millions of times a month, and it's an agent that runs code on developer machines with developer credentials — if this chain had actually been weaponized into a malicious release, the blast radius would approach that of the 2025 Shai-Hulud npm supply chain worm.
If your team also lets an AI coding agent handle issue triage, PR review, or any step in CI, the attack surface this incident represents isn't "will this agent follow a malicious instruction" — it's "which credentials in this agent's execution environment is it able to touch that it shouldn't be able to touch."
Takeaway
What's genuinely interesting about this chain is that the only "AI" part of it is the opening prompt injection — everything after that, from the sandbox escape to the cache poisoning to trading up for an OIDC token, is a straightforward CI/CD security problem that has nothing to do with how smart the model is. The lesson is that defending an AI agent's attack surface can't stop at "can we get the model to refuse a malicious instruction" — every shared runner, every unauthenticated local channel, and every overly-privileged neighboring workflow in the agent's execution environment is one more link this kind of chain can walk down.
References
- Depi — Backdooring the next release of Codex through GitHub Action pipeline exploit chaining
- SecurityWeek — In Other News: New CISA Director Nominee, Connected Car Hacking, Baker Tilly Data Breach (includes the OpenAI Codex backdoor risk item)
- The Defiant / Frontier — Researchers Say Codex Flaw Put npm Releases at Risk
- Cacheract — GitHub Actions cache poisoning tool by Adnan Khan
- Unit 42 — Shai-Hulud npm supply chain worm
- OWASP Top 10 for LLM Applications