One GitHub Issue Could Have Backdoored OpenAI's Codex CLI on npm: Prompt Injection, Runner Memory Reads and Cache Poisoning Formed a Path to the Release Pipeline

Researchers showed how an AI issue-labelling workflow in the openai/codex repository could be pushed from a public issue to stolen Actions tokens, a poisoned cache and npm trusted publishing; OpenAI fixed it and no malicious release is known.
Overview
Security researchers have shown how a single GitHub issue could have started a chain ending in a backdoored release of OpenAI's Codex CLI on npm, a package downloaded millions of times a month. The chain began with an AI-powered issue-labelling workflow in the openai/codex repository that put any issue's title and body straight into the Codex agent's prompt. From there it escaped the agent's sandbox, stole GitHub Actions tokens from runner memory, poisoned a build cache and set a trap for the release pipeline.
The researchers reported it through OpenAI's bug bounty programme with a full proof of concept. OpenAI deployed a fix straight away and paid an initial $1,000 bounty. There is no evidence a malicious release was ever published. The write-up was released on 11 November 2026.
The Vulnerability Chain
- Untrusted input into an agent. The Issue Labeler workflow ran
openai/codex-actionwhenever an issue was opened or labelled, withallow-users: "*". Anyone with a GitHub account could trigger it just by opening an issue, and the issue text went into the agent's prompt. Prompt injection in that text got the agent to run shell commands on the runner. - A sandbox with a gap. The agent ran in a
workspace-writesandbox: seccomp filters with no network and noptrace, a restricted PID namespace, writes limited to the workspace and/tmp, and no sudo. But it still allowed opening files. - Debug pipes in /tmp. The GitHub Actions runner is a .NET application. Its
Runner.ListenerandRunner.Workerprocesses expose CoreCLR diagnostic pipes in/tmp. The researchers describe this interface as unauthenticated and able to read memory, and it was reachable through ordinary file access. - Secrets the sandbox had stripped.
Runner.Workermemory still held the environment variables the sandbox had removed, including runner and GitHub tokens. - Exfiltration via logs. With no network, the tokens were printed into the job log in chunks long enough to avoid GitHub's masking of short strings.
- Cache poisoning. A separate
rust-ci.ymlworkflow with write permissions restored a GitHub Actions cache. Cache archives are extracted without integrity checks, and the cache key did not depend on any secret. With the stolen token, an attacker could pre-seed a malicious cache entry that would run inside the privileged job. - Release trap. The final step targeted a release workflow that holds
id-token: write. The OIDC token it gets can be exchanged with npm under trusted publishing. That would allow publishing a malicious@openai/codexversion.
Timeline
All times are Mauritius time (UTC+4).
- Before November 2026 – the researchers report the chain to OpenAI through its bug bounty platform. The exact report and fix dates have not been published.
- Shortly after the report – OpenAI deploys a fix and pays an initial $1,000 bounty. The report is still under review, and OpenAI's programme lists up to $100,000 for critical findings.
- 11 November 2026 – the technical write-up is published.
Tradecraft
This is a CI/CD supply-chain attack with an AI agent as the way in:
- Prompt injection as initial access. The attacker never touches the code, only the text the agent reads.
- Sandbox escape through host IPC. The sandbox blocked sockets and ptrace but left file-based IPC to more privileged processes on the same host reachable.
- Pivot between workflows. Low-privilege job → stolen token → shared cache → high-privilege job → OIDC → registry.
It follows a wider run of attacks on GitHub Actions secrets this month, but this chain needed no stolen account at all, just an issue.
Detection
For teams running AI agents or any untrusted-input workflow in GitHub Actions:
- Search workflows for agent actions triggered by
issues,issue_comment,pull_request_targetordiscussionevents, especially with wildcard user allow-lists. - Review job logs for long base64- or hex-like blobs printed by agent steps.
- Audit cache entries created by low-privilege workflows and restored by privileged ones.
- Alert on release deletions and unexpected runs of publishing workflows, and check registry publish history against tagged releases.
# Find workflows that feed issue/PR text to an agent or run on risky triggers
grep -rnE "issues:|issue_comment:|pull_request_target:" .github/workflows/
grep -rnE "allow-users:\s*\"?\*" .github/workflows/
grep -rnE "github\.event\.(issue|comment|pull_request)\.(title|body)" .github/workflows/
Recommended Actions
- Never give AI agents unfiltered issue or PR text in workflows that hold secrets or tokens. Restrict triggers to trusted collaborators and avoid wildcard user lists.
- Least privilege everywhere. Set
permissions:to read-only by default at workflow level and grant write only to the job that needs it. - Use ephemeral, isolated runners for agent jobs, separate from build and release jobs, so no shared host processes or caches link them.
- Don't restore caches into privileged or release jobs, or split cache scopes by trust level.
- Protect publishing. Put OIDC/trusted-publishing jobs behind GitHub environments with required reviewers, and pin trusted publishing to a specific workflow and environment.
- Consumers: add a short cooldown before auto-updating developer tools from npm, and pin versions in CI.
Analyst Assessment
OpenAI fixed this quickly, and nothing suggests it was exploited. The lesson is broader than one repository. Any project that adds an AI agent to issue triage effectively lets the public run code, and agent sandboxes are designed to stop the agent misbehaving, not to resist a determined attacker on a shared runner. The jump from a $0 issue to a possible npm release shows how short the gap between "helpful bot" and "supply-chain compromise" can be. Expect more research on agent-in-CI chains, and audit your own workflows now.
