# Ultralytics build cache poisoning

incident, `incident:ultralytics`. Page: https://ghtier.com/incidents/ultralytics

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.

**Abused:** [Contents: Write (repository)](https://ghtier.com/tier/permissions/contents-write.md) (Tier 2), [Workflows: Write (repository)](https://ghtier.com/tier/permissions/workflows-write.md) (Tier 1)

**Used:** [Push directly, without review](https://ghtier.com/attack-paths/technique-no-review.md) (Tier 2), [Run PR code in a privileged workflow](https://ghtier.com/attack-paths/technique-pwn-request.md) (Tier 1), [Poison a shared Actions cache](https://ghtier.com/attack-paths/technique-cache-poison.md) (Tier 1), [Publish a malicious version with a stolen token](https://ghtier.com/attack-paths/technique-malicious-release.md) (Tier 1), [Release through the project's own pipeline](https://ghtier.com/attack-paths/technique-release-provenance.md) (Tier 2), [Poison a cache the release build restores](https://ghtier.com/attack-paths/escalation-fork-pr-to-cache.md) (Tier 1)

**Sources:**
- [zizmor would have caught the Ultralytics workflow vulnerability](https://blog.yossarian.net/2024/12/06/zizmor-ultralytics-injection)
- [Supply-chain attack analysis: Ultralytics (PyPI)](https://blog.pypi.org/posts/2024-12-11-ultralytics-attack-analysis/)
- [Ultralytics issue #18027: the 8.3.41 wheel differs from the source](https://github.com/ultralytics/ultralytics/issues/18027)
- [GHSA-7x29-qqmq-v6qc: script injection in ultralytics/actions](https://github.com/ultralytics/actions/security/advisories/GHSA-7x29-qqmq-v6qc)
- [The Monsters in Your Build Cache: GitHub Actions cache poisoning](https://adnanthekhan.com/2024/05/06/the-monsters-in-your-build-cache-github-actions-cache-poisoning/)
- [The Ultralytics supply chain attack: connecting the dots](https://blog.gitguardian.com/the-ultralytics-supply-chain-attack-connecting-the-dots-with-gitguardians-public-monitoring-data/)
- [Ultralytics AI pwn request supply chain attack](https://snyk.io/blog/ultralytics-ai-pwn-request-supply-chain-attack/)
- [The Ultralytics supply chain attack: how it happened, how to prevent](https://www.legitsecurity.com/blog/the-ultralytics-supply-chain-attack-how-it-happened-how-to-prevent)
- [Ultralytics AI library hacked via GitHub for cryptomining](https://www.wiz.io/blog/ultralytics-ai-library-hacked-via-github-for-cryptomining)

From ghtier (https://ghtier.com). Every entry and link: https://ghtier.com/data/graph.json. Tiers: https://ghtier.com/tier.
