# Codex: a GitHub issue reached the tokens that publish its npm package

> A GitHub issue opened by anyone could make Codex leak the tokens behind its own release pipeline, Depi reports.

- **Severity:** Medium: Real and reproducible, but needs unusual setup, user help or a narrow audience. Plan a fix.
- **Category:** Vulnerability, Supply chain
- **Published by:** Depi
- **Disclosed:** 2026-11-11
- **Affects:** OpenAI Codex, GitHub Actions
- **Research by:** Pierre Martin, Garance de la Brosse
- **Primary source:** https://depi.security/blog/20261111-backdooring-codex/
- **Page:** https://theinjection.dev/items/depi-codex-issue-labeler-pipeline-chain/

Two Depi researchers chained a prompt injection in the openai/codex issue triage workflow to a sandbox escape and cache poisoning, reaching tokens that could publish a backdoored @openai/codex npm release. OpenAI has fixed the workflow.

## What happened

Depi published the chain on 11 November 2026, after reporting it to OpenAI through Bugcrowd. Pierre Martin and Garance de la Brosse found that the issue-labeler workflow in the openai/codex repository fed the title and body of any new issue straight into the Codex prompt, with allow-users set to the wildcard. OpenAI deployed a fix and paid an initial bounty of $1,000, with the report still under review.

## How it works

Injected issue text made the model treat attacker content as workflow instructions, which gave command execution inside the Codex sandbox. The sandbox blocked network sockets and ptrace, but the GitHub runner's .NET processes left CoreCLR debug pipes in /tmp, and a pipe opens like a regular file, so the sandbox permitted it. That debug protocol was unauthenticated and offered a memory-read primitive, which recovered runner and GitHub tokens from process memory. The authors then poisoned a GitHub Actions cache restored by a workflow that holds write permissions.

## Who is affected

The flaw sat in OpenAI's own repository workflow, so people running the Codex CLI were never served a malicious release. Any project that passes untrusted issue or pull request text to an agent action, or sets allow-users to the wildcard, starts from the same condition. The CoreCLR debug pipe escape applies to agent sandboxes running on GitHub-hosted .NET runners.

## What to do

Check agent workflows for a wildcard allow-users value and for untrusted issue or pull request text reaching the prompt. Depi also suggests waiting a short while before auto-updating agent tooling, so that a bad release has time to be noticed.

## Quick facts

- **Affected:** openai/codex issue-labeler workflow
- **Status:** Fixed by OpenAI
- **Entry point:** Any newly opened GitHub issue
- **Escape:** CoreCLR debug pipes on the runner
- **Reported via:** Bugcrowd
- **Bounty:** $1,000 initial, report under review
- **Disclosed:** 2026-11-11

## Questions

### Do I need to update the Codex CLI because of the Depi finding?

No update to the Codex CLI is needed. Depi reports that the flaw sat in the issue-labeler workflow inside OpenAI's own codex repository, and that OpenAI deployed a fix after the Bugcrowd report. No malicious @openai/codex release was published. Depi does suggest a short cooldown before auto-updating agent tooling in general, so a bad release can be spotted first.

### How did the attack escape the Codex sandbox?

The Codex sandbox ran in workspace-write mode, which blocked network sockets and ptrace. Depi found that the GitHub runner's Runner.Listener and Runner.Worker .NET processes exposed CoreCLR debug pipes in /tmp. Because a pipe opens like a regular file, the sandbox permitted access, and the unauthenticated debug protocol gave a memory-read primitive that recovered runner and GitHub tokens from process memory.

### Was a backdoored @openai/codex package actually published?

No backdoored package reached npm. Depi describes the final step, a fake release whose deletion triggers a workflow that requests an OIDC token exchangeable for npm publishing rights, as a potential path, and credits the technique to Adnan Khan. The authors demonstrated the token theft and the cache poisoning, then reported the chain instead of completing it.

## Sources

1. [Depi Write-Up](https://depi.security/blog/20261111-backdooring-codex/)
2. [Codex Action Repo](https://github.com/openai/codex-action)
