# CVE-2025-54575: ImageSharp Triggers an Infinite Loop in its GIF Decoder When Skipping Malformed Comment Extension Blocks

> Attackers can cause a denial of service in applications using ImageSharp by submitting a specially crafted GIF file that triggers an infinite loop in the decoder.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Jul 2025
- **Updated:** 30 Jul 2025
- **Also known as:** ECHO-fffa-11ee-e557, GHSA-rxmq-m78w-7wmc

## What is CVE-2025-54575?

CVE-2025-54575 is a medium-severity denial of service vulnerability in SixLabors ImageSharp, published on 30 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

ImageSharp is a 2D graphics library. In versions below 2.1.11 and 3.0.0 through 3.1.10, a specially crafted GIF file containing a malformed comment extension block (with a missing block terminator) can cause the ImageSharp GIF decoder to enter an infinite loop while attempting to skip the block. This leads to a denial of service. Applications processing untrusted GIF input should upgrade to a patched version. This issue is fixed in versions 2.1.11 and 3.1.11.

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling), CWE-400 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2025-54575?

4 open source packages ship an affected version, including SixLabors.ImageSharp.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `SixLabors.ImageSharp` | NuGet | All versions | 2.1.11 |
| `SixLabors.ImageSharp` | NuGet | All versions | 2.1.11 |
| `SixLabors.ImageSharp` | NuGet | From 3.0.0 | 3.1.11 |
| `SixLabors.ImageSharp` | NuGet | From 3.0.0 | 3.1.11 |

## How do I fix CVE-2025-54575?

Upgrade SixLabors.ImageSharp to a fixed version for your release line: 2.1.11 or 3.1.11.

## Is CVE-2025-54575 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54575 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-54575 and fix it if it is affected.

What it is: CVE-2025-54575 is a medium-severity denial of service vulnerability in SixLabors ImageSharp, published on 30 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54575 exists.

Affected packages and fixed versions:
- SixLabors.ImageSharp (NuGet): affected all versions; fixed in 2.1.11
- SixLabors.ImageSharp (NuGet): affected all versions; fixed in 2.1.11
- SixLabors.ImageSharp (NuGet): affected from 3.0.0; fixed in 3.1.11
- SixLabors.ImageSharp (NuGet): affected from 3.0.0; fixed in 3.1.11

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/CVE-2025-54575/ (Markdown: https://insights.sbomify.com/CVE-2025-54575/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-54575
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-54575
- OSV: https://osv.dev/vulnerability/CVE-2025-54575

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