Get a demo — 30 minutes →
← Back to blog
Anomity robot illustrating A GitHub Issue Could Steer OpenAI's Codex Toward Its Own npm Release - The Depi Chain Explained
Research

A GitHub Issue Could Steer OpenAI's Codex Toward Its Own npm Release - The Depi Chain Explained

TL;DR
  • On November 11, 2026 the research firm Depi published an exploit chain that starts with a GitHub issue and ends with what it calls a path to publishing the official @openai/codex npm package. The entry point was an issue-labeling workflow in the openai/codex repository that passed the issue's title and body straight into the Codex agent's prompt, with allow-users: "*", so anyone who could open an issue could write to the prompt.
  • In Depi's test repository, a crafted issue got Codex to run an encoded script, which then escaped the workspace-write sandbox by opening the GitHub runner's .NET debug pipes in /tmp/ and reading GITHUB_TOKEN and ACTIONS_RUNTIME_TOKEN out of the runner's process memory. Those tokens let Depi poison the Actions cache of a more privileged workflow and set up a path to an OIDC token npm trusts for publishing.
  • Depi reported the chain through Bugcrowd. It says OpenAI deployed a fix right away and paid an initial $1,000 bounty, with the report still under review. Depi does not report that any malicious release was published. On November 11 (UTC) OpenAI also replaced the agent in that workflow with a plain Responses API call with tools disabled and a strict JSON schema.
  • One caveat matters: OpenAI's public workflow file had specified sandbox: read-only since it was added in May, while Depi describes escaping workspace-write. Depi's post does not say whether it tested the escape against that tighter setting. The broader lesson holds either way: an agent that reads untrusted text should not share a host with secrets it could reach.
  • For security teams: find every place an AI agent reads issues, PR text or comments with credentials nearby, keep allow-users narrow, and consider a short cooldown before auto-updating agent CLIs. @openai/codex was downloaded about 96.8 million times in the 30 days to November 10, according to npm's public download counts.

The short version: a coding agent that reads text from strangers is an execution path, and in a CI pipeline that path can run very close to release credentials. Research the security firm Depi published on November 11, 2026 walks through how one GitHub issue, read by the Codex agent inside OpenAI's own openai/codex repository, could be turned into shell commands, then a sandbox escape, then stolen workflow tokens, and finally a route to the signing token npm accepts for publishing @openai/codex, the package behind Codex CLI. Depi reported it through Bugcrowd and says OpenAI fixed the core bug right away.

We have covered the same pattern against other vendors' agents in Comment and Control, where PR titles and comments steered Claude Code, Gemini CLI and Copilot agents into leaking secrets, and in an earlier Codex case, a branch name that became a command injection. What is new here is how far the chain went after the first command ran, and which component it went through: not a bug in the model, but the ordinary plumbing of a GitHub Actions runner.

What to do now

  • Find agents that read untrusted text. List every workflow that runs a coding agent, such as openai/codex-action, the Claude Code action or run-gemini-cli, on issue, comment or pull request events, and note what secrets and permissions that job can reach.
  • Keep the trigger list narrow. openai/codex-action only runs for users with write access unless allow-users widens it. Treat allow-users: "*" on a public repository as "anyone on the internet can write to this prompt".
  • Do not give classification jobs an agent. If the job is to pick labels, a model call with tools disabled and a fixed output schema does the work without a shell. That is the change OpenAI made to its own labeler on November 11.
  • Pick the tightest sandbox and isolate the job. Prefer a read-only or narrow permission profile, run agent jobs separately from jobs that hold write or id-token: write permissions, and do not restore shared caches into privileged jobs without checking them.
  • Slow down agent CLI updates a little. Depi's own takeaway for users is a short cooldown on tooling that updates itself, so a poisoned release has time to be caught before it reaches developer laptops.
  • Know where the CLI runs. If a bad release of any agent CLI ever ships, the first question is which machines installed which version, and when.

How the chain worked, step by step

1. The prompt. The openai/codex repository ran an Issue Labeler workflow whenever an issue was opened or labeled. It called openai/codex-action and built the prompt by inserting the issue's title and body after the workflow's own instructions. With allow-users: "*", that included issues from anyone. Depi found a pattern that made the model read the issue body as new instructions rather than data: a short prefix that imitated the end of the workflow's prompt, followed by a fake role as a QA engineer told to run diagnostic commands. To get past Codex's guardrails, the payload script was compressed and encoded so the model ran it without recognizing what it did. Depi shows this working in its own test repository.

2. The sandbox. Depi describes the workspace-write sandbox it faced: seccomp filters blocking network calls and process debugging, a PID namespace that hides other processes, writes limited to the workspace and /tmp/, and sudo dropped. Sensitive environment variables such as the GitHub token are removed before the agent runs.

3. The escape. The GitHub Actions runner is a .NET application, and its Runner.Listener and Runner.Worker processes leave CoreCLR debugger pipes in /tmp/. The sandbox blocked connect(), so the diagnostic socket was out of reach, but on Linux a named pipe is opened like a file, and open() was allowed. Through those pipes the debugger protocol offers unauthenticated reads of process memory. The tokens stripped from the agent's environment were still sitting in the Runner.Worker process, and Depi's script read them back out: GITHUB_TOKEN and ACTIONS_RUNTIME_TOKEN, printed into the run's output in chunks so they came back through the logs.

4. The pivot. The runtime token grants read and write access to the repository's Actions cache while the job runs, and it works from anywhere, including an attacker's own workflow. Depi used Adnan Khan's Cacheract tool to plant a cache entry for rust-ci.yml, a more privileged workflow that restores Rust binaries from cache and then runs Python tests. The poisoned entry dropped an extra test file into that job, which then ran with the workflow's write permissions.

5. The release path. From there, Depi describes a trap built on a technique Adnan Khan shared with them: commit a workflow that fires when a release is edited or deleted and requests id-token: write, then publish a fake release. When a maintainer deletes the fake release, the hidden workflow runs and can obtain a signed OIDC token, which npm's trusted publishing accepts. Depi presents that as the point where a malicious @openai/codex version could have been published. Its post does not report publishing one.

StageWhat Depi usedWhat it gave
Prompt injectionIssue title and body inserted into the Codex prompt, allow-users: "*"Shell commands inside the agent sandbox
Sandbox escapeCoreCLR debug pipes in /tmp/, opened as filesRead access to runner process memory
Token theftMemory scan of Runner.WorkerGITHUB_TOKEN, ACTIONS_RUNTIME_TOKEN
Cache poisoningMalicious cache entry for rust-ci.ymlCode running in a workflow with write access
Release trapWorkflow on release edit or delete with id-token: writeA path to an npm-trusted OIDC token

What OpenAI changed, and the caveat

Depi says it sent the full proof of concept to OpenAI through Bugcrowd, that OpenAI acknowledged the severity and deployed a fix right away, and that it received an initial $1,000 bounty while the report is still under review. Depi does not detail what the fix was. Separately, the public history of the openai/codex repository shows that on November 11 (UTC) OpenAI merged a change that removes the Codex agent from the labeler entirely: label suggestions now come from a Python script that calls the Responses API with tools disabled and a strict JSON schema, and only validated labels are applied.

There is one gap between the write-up and the production setup that readers should know about. Depi's post and its Bugcrowd summary describe escaping the workspace-write sandbox, and the end-to-end demonstration ran in Depi's test repository. The labeler in the public openai/codex repository had specified sandbox: read-only and safety-strategy: drop-sudo since the file was added on May 15, 2026, a line Depi's quoted configuration leaves out. Depi does not say whether it tested the debug-pipe escape against that tighter mode, so the full takeover is demonstrated on a test configuration, not shown on OpenAI's live one. The prompt injection surface itself, untrusted issue text inside an agent prompt open to every user, was present in the production file until the November 11 change.

The caveat narrows the claim, but not the lesson. openai/codex-action's own documentation notes that even in read-only mode the OpenAI API key flows through a proxy that Codex could read if it can reach process memory. Sandbox modes govern files and network. A runner that also hosts tokens in neighboring processes is a different boundary, and that is the one Depi crossed.

Why this matters beyond one repository

Depi's closing point is about scale and update habits. Codex CLI is not a library pinned in a lockfile; it is an agent that runs on developer machines with developer credentials and is built to execute code, so a poisoned version does not need a trick to run. npm's public download counts show @openai/codex at about 96.8 million downloads in the 30 days to November 10, 2026, and about 26 million in the week to November 10. Depi notes that anyone running Codex CLI with automatic updates on would not get a chance to review a new version before it arrived. We saw the same dynamic with the Shai-Hulud npm worm, which spread through trusted maintainer accounts.

For security teams the useful takeaways are structural. Text from issues, PRs, comments, READMEs and web pages is untrusted input to any agent that reads it. A sandbox is only as strong as what else lives on the same host. And the agent CLIs on your laptops sit downstream of release pipelines you do not control, which is why knowing how the Codex sandbox and approval model works is only half the job; the other half is knowing where Codex runs and in what configuration.

How Anomity surfaces and governs it

See it. The Anomity Endpoint Sensor inventories Codex CLI and the other AI agents and CLIs on every managed Windows, macOS and Linux endpoint, including the installed Codex CLI version, along with the MCP servers, skills, hooks and secrets around them. If a bad release of an agent CLI ever ships, that turns "which laptops have it" into a query rather than a survey. Cloud discovery adds the GitHub OAuth grants AI apps hold in your organization, so you can see which AI tools were given access to your repositories.

Enforce before the call runs. On agents that expose a hook, such as Claude Code PreToolUse or Codex CLI, Anomity's managed hooks can allow, deny or log a tool call before it runs, so a policy can stop an agent from decoding and running a script it was handed in a ticket, or from reading files it has no reason to touch. Keep the record. Decisions and configuration changes land in a 90-day audit trail, metadata only with secrets redacted on the endpoint, and route to SIEM, Slack, email or Jira. Anomity is SOC 2 Type II and complements CI hardening, EDR, DLP and GRC tooling; it does not replace them. To see where coding agents run across your fleet today, book a 30-minute demo.

Frequently asked questions

What did Depi find in OpenAI Codex?

Depi, a security firm, published research on November 11, 2026 showing an exploit chain that began with a prompt injection in the Issue Labeler workflow of OpenAI's openai/codex GitHub repository. The workflow inserted the title and body of new issues into the Codex agent's prompt and allowed any user to trigger it. In its test repository, Depi turned that into shell commands inside the agent sandbox, escaped the sandbox through the GitHub runner's .NET debug pipes, read GITHUB_TOKEN and ACTIONS_RUNTIME_TOKEN from runner memory, poisoned the Actions cache of a more privileged workflow, and described a path to an OIDC token that npm accepts for publishing @openai/codex.

Was a malicious version of Codex CLI published?

Depi does not report that any malicious release was published. It describes reporting the chain to OpenAI through Bugcrowd, and says OpenAI deployed a fix right away. Depi's own advice to Codex users is that there is nothing to patch on their side.

How did the sandbox escape work?

The GitHub Actions runner is a .NET application whose processes leave CoreCLR debugger pipes in /tmp/. The Codex sandbox blocked network connections, including the connect() call needed for the diagnostic socket, but a named pipe on Linux can be opened like a regular file with open(), which was allowed. The debugger protocol on those pipes allows unauthenticated reads of process memory, and the tokens removed from the agent's environment were still in the Runner.Worker process.

Did the attack work against OpenAI's production configuration?

Depi demonstrated the chain in its own test repository and describes escaping the workspace-write sandbox. The labeler in the public openai/codex repository had specified sandbox: read-only since the file was added on May 15, 2026, and Depi does not say whether it tested the escape against that mode. The prompt injection itself, untrusted issue text in a prompt open to every user, was present in the production workflow until OpenAI replaced the agent with a tools-disabled Responses API call on November 11 (UTC).

What did OpenAI change?

Depi says OpenAI deployed a fix right away, without detailing it, and paid an initial $1,000 bounty with the report still under review. The public openai/codex repository also shows a change merged on November 11 (UTC) that replaces the Codex action in the Issue Labeler with a Python script calling the Responses API with tools disabled and a strict JSON schema, applying only validated labels.

How do I secure my own workflows that use AI coding agents?

Treat issue bodies, PR titles and descriptions, comments, commit messages and repository instruction files as untrusted input. Keep allow-users on openai/codex-action, and similar settings on other agent actions, limited to trusted maintainers. Use a model call with tools disabled for pure classification jobs, choose the narrowest sandbox or permission profile, separate agent jobs from jobs with write or id-token permissions, and avoid restoring shared caches into privileged jobs unchecked.

How does Anomity help with this?

The Anomity Endpoint Sensor inventories Codex CLI, including its installed version, and other AI agents and CLIs on every managed endpoint, together with their MCP servers, skills, hooks and secrets, so you can see where coding agents run and which versions are installed. Cloud discovery lists GitHub OAuth grants held by AI apps. On agents that expose a hook, such as Claude Code PreToolUse or Codex CLI, Anomity's managed hooks can allow, deny or log a tool call before it runs. Decisions land in a 90-day audit trail and route to SIEM, Slack, email or Jira. Anomity complements CI hardening, EDR and DLP; it does not replace them.

Ask AI about Anomity
ChatGPT Claude Perplexity Google AI Grok