ghtier

These write-ups are not threat intelligence and are not kept up to date as an incident develops. They are here to show how each attack worked, so you can find and fix the same techniques in your own setup. For the latest on an incident, read its sources.

← All incidents

Ultralytics build cache poisoning

December 2024 · Contained

A branch name ran as a shell command in a pull_request_target workflow, and the code it fetched poisoned the Actions cache that Ultralytics' release job restored, so two releases built and published through Trusted Publishing carried a cryptominer. Two days later two more malicious versions went to PyPI straight from an old API token.

Access held
T1Workflows: WriteT2Contents: WriteActions cache tokenCode in the release buildPyPI API token
Full summary

The ultralytics/ultralytics repository ran a formatting workflow on pull_request_target that called the project's own composite Action, which put the pull request's branch name straight into a git pull shell command. Adnan Khan had reported that injection in August 2024 and it was fixed the same day, but a later version of the Action brought it back. On 4 December 2024 the openimbot account opened pull requests from branches whose names fetched and ran a script. The script was a copy of Khan's published cache poisoning proof of concept: it read the runner's memory for the Actions cache token and cache URL and sent them out, and researchers believe it then wrote a poisoned pip cache entry under the key the release workflow used. Within the hour a commit under the UltralyticsAssistant bot's name bumped the version to 8.3.41 and removed the check that only let glenn-jocher trigger a release. The release job restored the poisoned cache, built a package with an XMRig miner in it and published it through Trusted Publishing, with valid provenance. 8.3.42, released by the maintainer the next day, was also malicious. On 7 December 8.3.45 and 8.3.46 were uploaded directly with a PyPI API token left over from before Trusted Publishing, with no CI run behind them.

How it unfolded

Pick a step to zoom into it. A dashed line is a step the sources do not state. Blue dots are the checklist items that break the step.

Whole path

Untrusted input reaches aprivileged workflowway inRun PR code in a privilegedworkflowtechniqueActions cache tokenformat.yml job's runnerContents: WriteUltralyticsAssistant's PATWorkflows: WriteThe same PATPoison a cache the releasebuild restoresescalationCode in the release buildpublish.yml's pip cachePush directly, withoutreviewtechniqueRelease through theproject's own pipelinetechniquePoison the build orpublished packageLeaked tokenway inPyPI API tokenAn unrevoked CI secretPublish a malicious versionwith a stolen tokentechniquePoison the build orpublished package

The whole attack, one row per step. Pick a step on the left, or click a box in its row.

Frameworks

Part of

Contained. First seen December 2024. Mapping by ghtier, not yet reviewed. Threat landscape

Sources

Reported by: GitGuardian