codex2api release chain poisoned, three versions backdoored

codex2api release chain poisoned, three versions backdoored

The release pipeline of the open-source project codex2api was tampered with on Nov. 23. According to an incident postmortem published by a community member, the attacker used the repository owner's account credentials to push tags directly, bypassing the main branch, and released three backdoored versions, v3.1.10, v3.1.11 and v3.1.12, in a stretch of just over an hour between 13:00 and 14:00 Beijing time. Anyone who installed or updated to any of these three versions should stop using them and roll back to v3.1.9.

codex2api is a gateway that converts upstream Codex capabilities into an OpenAI-compatible API, with an admin console and an “online update” feature. Data cited in the postmortem shows the repository has about 2,400 stars and 449 forks.

Three versions, with the hole getting wider each time

v3.1.10 added a hidden route. A request carrying a header hard-coded in the source code makes the server run arbitrary commands through /bin/sh -c and return the output. A few minutes after release, the attacker triggered a cleanup workflow that deleted this release and its tag.

The tag for v3.1.11 appeared 36 minutes later, and the key change is a single one: the header check was removed. Anyone could now execute commands remotely, with no credentials, by sending a request with a cmd parameter to the designated path. The postmortem's author downloaded the official linux_amd64 archive to verify it; its hash matched the release page, and the backdoor route string could be found in the binary.

v3.1.12 kept the previous version's route and added another one that supports four modes: running commands, exporting 10 environment variables including the database and Redis passwords, executing arbitrary SQL, and opening arbitrary TCP connections. It was cleaned up in the same way about 15 minutes after going live.

Of the three versions, only v3.1.11 was not deleted. When the postmortem took its snapshot at 15:10 Beijing time, it still carried the Latest label, and the admin console's online update would push it to users. The online update only checks the checksum shipped with the release and does not verify a signature, so the malicious version passes anyway.

On Linux and macOS the backdoor can be exploited directly. Native Windows has no /bin/sh, so the backdoor cannot run there, but the binary was modified all the same.

Beyond the releases, a round of secret theft

Under the same account, the attacker also ran a credential-stealing workflow that packed the repository's Actions secrets, encoded them, split them into chunks and sent them to a server hosted in a data center in Los Angeles, USA. In the codex2api repository, 16 secret names were exfiltrated, including a deployment SSH key, a DockerHub token, a messaging bot token, a DeepSeek API key and a GitHub token.

The same toolkit scanned 21 repositories under the account in about half an hour, deleting the temporary branch after each repository had been processed. The account has 99 repositories in total.

In an issue, the repository owner responded that after investigating, they suspect a GitHub token had been stored on a server set up long ago and that this server was compromised. This is the owner's own assessment. The postmortem argues that “account takeover” cannot yet be told apart from other possibilities, and neither side has produced GitHub security logs.

What users should do

The remediation advice in the postmortem and the issue is broadly consistent:

  • Do not install or online-update to v3.1.10 through v3.1.12, and do not click “Update” in the admin console;
  • If you already installed one, stop the service and redeploy v3.1.9 on a clean host or container rather than patching the original machine;
  • Treat the admin key, the database and Redis passwords, API keys issued by the service and upstream account tokens stored in the database as compromised, and rotate each of them;
  • Check access logs for requests starting with /i674 or /qa67181, and for outbound connections to 104.223.21.19.

On the Docker images, the postmortem is not fully consistent with itself: one passage says the image never carried the backdoor, while another warns that anyone who pulled latest between 13:20 and 13:31 Beijing time should be treated as affected. The safer course is to follow the latter.

Putting similar incidents side by side

We have covered several comparable incidents: LiteLLM 1.107.0 was poisoned to steal AI keys, a PyPI package of Microsoft's agent framework was poisoned, and Operation Artex, disclosed by Amazon last week, directly scours the public internet for large-model gateway keys. The targets overlap heavily, and all of them are middle layers that forward model requests on behalf of others. Such services hold both the upstream account tokens and the downstream users' keys, so when one is taken over, what is lost is a whole string of credentials.

As of the postmortem snapshot, several things remain unclear: which of the 16 secrets actually held live values, whether the other 78 repositories were touched, and whether the credentials in the attacker's hands are still valid. The owner's issue comments do not mention having deleted v3.1.11 or having released a clean new version, and whether anything has changed since the snapshot cannot be verified here.

Sources: codex2api project issue, CocoLoop, community incident postmortem; the postmortem document was used to verify the order of versions, the backdoor behavior and the number of affected repositories.