# PYSEC-2024-154: A number of releases of ultralytics contained malicious crypto miner software.

> Attackers can execute arbitrary code via malicious cryptocurrency miner software injected into compromised ultralytics package releases.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Dec 2024

## What is PYSEC-2024-154?

PYSEC-2024-154 is a vulnerability in ultralytics, published on 10 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Ultralytics has identified a supply chain attack
affecting affecting multiple versions of the ultralytics package.
The compromised versions contained unauthorized code that
downloaded and executed cryptocurrency mining software
when instantiating YOLO models.
This code was injected into the PyPI release artifacts and was not present
in the public GitHub repository.

## Which versions are affected by PYSEC-2024-154?

1 open source package ship an affected version, including ultralytics.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ultralytics` | PyPI | From 8.3.41 | 8.3.47 |

## How do I fix PYSEC-2024-154?

Upgrade ultralytics to 8.3.47 or later.

## Is PYSEC-2024-154 being exploited?

There is no known exploitation of PYSEC-2024-154 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for PYSEC-2024-154 and fix it if it is affected.

What it is: PYSEC-2024-154 is a vulnerability in ultralytics, published on 10 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of PYSEC-2024-154 in the wild and no public exploit code.

Affected packages and fixed versions:
- ultralytics (PyPI): affected from 8.3.41; fixed in 8.3.47

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/PYSEC-2024-154/ (Markdown: https://insights.sbomify.com/PYSEC-2024-154/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/PYSEC-2024-154

---
From sbomify Insights: https://insights.sbomify.com/PYSEC-2024-154/
Summaries are generated and may contain mistakes; the official description above is the record.
