From a GitHub issue to npm publishing rights: the Codex labeler chain
Depi showed how a prompt-injected issue labeler in the Codex repository could lead to its npm publishing credentials. The chain, the fixes and what to change.
An issue labeler is about as harmless as automation gets. On 11 November 2026 the security firm Depi published a write-up showing how the one in OpenAI's Codex repository could have been the first step towards publishing a tampered release of the @openai/codex npm package. The chain started with text in a GitHub issue and ended, on paper, with a token npm would trust. OpenAI fixed it after a private report. The lessons apply to any repository that lets an AI agent read untrusted input inside CI.
What the workflow did
According to Depi, the repository's issue labeler workflow ran whenever someone opened an issue. It called the openai/codex-action GitHub Action and placed the issue's title and body directly into the agent's prompt. It also set allow-users: "*", so anyone able to open an issue could trigger a run.
That setting matters. The action's own security guidance says that by default only people with write access to the repository can run it, and that widening the list should be done "with caution". The same page lists pull request bodies, commit messages, instruction files and screenshots as vehicles for prompt injection. An issue body belongs on that list too.
The chain, step by step
Depi's chain has five stages, drawn as seven steps in the diagram above. Each one crossed a boundary the next stage relied on.
- Instructions in data. A crafted issue made the model treat the issue body as a new set of instructions. Depi says it compressed and encoded its script so the agent would run it without recognising what it did.
- A sandbox with a gap. The agent ran in a workspace-write sandbox: no network, no process debugging, and only the working directory and
/tmpwritable. But the GitHub runner's own .NET processes leave debugging pipes in/tmp. On Linux a pipe is a file, so the sandboxed process could write to it. Depi used the runtime's debugging protocol over those pipes to read the memory of the runner's worker process and recover the job's tokens. - Tokens used elsewhere. The tokens were still valid outside OpenAI's environment for as long as the workflow ran. Depi split them into chunks so they survived in the run's output, then used them from its own workflow.
- A poisoned cache. Another workflow in the repository, with write permissions, restored a cache and then ran Python tests. Depi says the cache key could be computed without secrets, so it wrote a cache entry containing a malicious test file.
- A release trap. The final stage aimed for an OpenID Connect (OIDC) token, which npm accepts for trusted publishing. Depi describes using a fake release whose deletion would trigger a workflow with
id-token: write.
Depi's post shows the token leak working in its test environment and describes the remaining steps as what an attacker could then do. It does not report a malicious version of the package being published.
What changed afterwards
Depi says it reported the issue through OpenAI's bug bounty programme, that OpenAI "deployed a fix right away", and that an initial bounty of $1,000 was paid with the report still under review. The post does not say exactly what the fix changed.
The public repository shows one change. Pull request #60897, merged on 11 November 2026, replaced the issue labeler's use of the Codex action with a Python script that calls the Responses API "with tools disabled and a strict JSON schema", and validates the suggested labels before applying them. A labeler that cannot run commands and can only return a fixed shape of answer has far less to lose to a crafted issue.
GitHub has also narrowed the cache step. Its dependency caching reference now says that runs triggered by events outsiders can influence, such as issue_comment and pull_request_target, get read-only access to the default branch's caches unless a workflow explicitly opts out. The same page warns that "cache contents are not signed or verified". Depi notes that its cache technique no longer works for at-risk triggers.
Analysis: why this is more than one bug
None of the individual weaknesses is exotic. Prompt injection through issue text is the kind of input the action's own guidance warns about. For the cache step, Depi used Cacheract, an existing public tool by the researcher Adnan Khan. What the write-up shows is how these pieces compose when an agent sits in the middle.
Three points stand out.
- The agent turned text into execution. Without the agent, a malicious issue body is just text. With an agent that can run commands, the issue becomes the first stage of an exploit. The question to ask of any CI agent is not "is the prompt well written" but "what can this job do if the prompt is hostile".
- Sandbox claims depend on the host. The sandbox blocked networking and debugging calls, yet the runner's own files gave a route out. A sandbox is only as strong as what the host leaves inside it.
- Permissions flow sideways. The labeler job itself had narrow permissions. The damage came from tokens reused elsewhere and from a different, more privileged workflow that trusted the cache. Reviewing workflows one at a time misses this.
There is also an uncomfortable cost asymmetry. Depi's chain needed one issue to start. Defending it requires every workflow in the repository to hold up.
What it means for engineering and security leaders
If your teams have added AI agents to issue triage, pull request review or release notes, those workflows now sit on your software supply chain. Treat them like code that handles untrusted input, because that is what they are.
Release credentials deserve particular attention. A package that runs on developer computers with developer credentials, as a coding agent does, is an attractive target for exactly the reason Depi gives: running is what it is for. Short-lived OIDC publishing is better than long-lived tokens, but it moves the question to which workflows can request that token and what can trigger them.
For teams consuming such tools, Depi suggests a short delay before taking automatic updates of tooling, so others have time to spot a bad release. That is a trade-off against patching speed, and worth deciding deliberately rather than by default.
Practical takeaways
- Find every workflow that feeds issue, comment or pull request text to an AI agent, and check who can trigger it. Remove wildcard user lists unless the job has no tools and no secrets.
- Prefer a tools-off call with a fixed output schema for classification jobs such as labelling. Validate the output before acting on it.
- Run agent steps in jobs with the fewest permissions and secrets possible, and assume anything in the job's memory can be read.
- Audit which workflows restore caches and then run code, and give jobs the narrowest cache access they need.
- List the workflows that can request
id-token: writeand the events that trigger them, including release edits and deletions. - Decide on an update delay for agent tools that auto-update on developer computers.
Sources
- Depi: Backdooring the next release of Codex through GitHub Action pipeline exploit chaining (11 November 2026)
- openai/codex pull request #60897: Use the Responses API for issue label suggestions
- openai/codex-action: security guidance
- GitHub Docs: Dependency caching reference (cache access for low-trust triggers)