# CVE-2025-58369: fs2: Half-shutdown of socket during TLS handshake may result in spin loop on opposite side

> An attacker can cause a CPU spin loop and denial of service in fs2-io TLS sessions by half-shutting down the socket during handshake.

- **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:** 5 Sep 2025
- **Updated:** 7 Nov 2025
- **Also known as:** GHSA-rrw2-px9j-qffj

## What is CVE-2025-58369?

CVE-2025-58369 is a medium-severity denial of service vulnerability in typelevel fs2, published on 5 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

fs2 is a compositional, streaming I/O library for Scala. Versions up to and including 2.5.12, 3.0.0-M1 through 3.12.2, and 3.13.0-M1 through 3.13.0-M6 are vulnerable to denial of service attacks though TLS sessions using fs2-io on the JVM using the fs2.io.net.tls package. When establishing a TLS session, if one side of the connection shuts down `write` while the peer side is awaiting more data to progress the TLS handshake, the peer side will spin loop on the socket read, fully utilizing a CPU. The CPU is consumed until the overall connection is closed, potentially shutting down a fs2-io powered server. This issue is fixed in versions  2.5.13, 3.12.1, and 3.13.0-M7.

Weakness: CWE-400 (Uncontrolled Resource Consumption)

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

34 open source packages ship an affected version, including co.fs2:fs2-io_2.12, co.fs2:fs2-io_0.26 and co.fs2:fs2-io_0.27.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `co.fs2:fs2-io_2.12` | Maven | All versions | 2.5.13 |
| `co.fs2:fs2-io_2.12` | Maven | All versions | 2.5.13 |
| `co.fs2:fs2-io_2.12` | Maven | From 3.0.0-M1 | 3.12.2 |
| `co.fs2:fs2-io_2.12` | Maven | From 3.0.0-M1 | 3.12.2 |
| `co.fs2:fs2-io_2.12` | Maven | From 3.13.0-M1 | 3.13.0-M7 |
| `co.fs2:fs2-io_2.12` | Maven | From 3.13.0-M1 | 3.13.0-M7 |
| `co.fs2:fs2-io_0.26` | Maven | All versions | None |
| `co.fs2:fs2-io_0.26` | Maven | All versions | None |
| `co.fs2:fs2-io_0.27` | Maven | All versions | None |
| `co.fs2:fs2-io_0.27` | Maven | All versions | None |
| `co.fs2:fs2-io_2.11` | Maven | All versions | None |
| `co.fs2:fs2-io_2.11` | Maven | All versions | None |
| `co.fs2:fs2-io_2.12.0-M4` | Maven | All versions | None |
| `co.fs2:fs2-io_2.12.0-M4` | Maven | All versions | None |
| `co.fs2:fs2-io_2.12.0-M5` | Maven | All versions | None |
| `co.fs2:fs2-io_2.12.0-M5` | Maven | All versions | None |
| `co.fs2:fs2-io_2.12.0-RC1` | Maven | All versions | None |
| `co.fs2:fs2-io_2.12.0-RC1` | Maven | All versions | None |
| `co.fs2:fs2-io_2.12.0-RC2` | Maven | All versions | None |
| `co.fs2:fs2-io_2.12.0-RC2` | Maven | All versions | None |
| `co.fs2:fs2-io_2.13` | Maven | All versions | 2.5.13 |
| `co.fs2:fs2-io_2.13` | Maven | All versions | 2.5.13 |
| `co.fs2:fs2-io_2.13` | Maven | From 3.0.0-M1 | 3.12.2 |
| `co.fs2:fs2-io_2.13` | Maven | From 3.0.0-M1 | 3.12.2 |
| `co.fs2:fs2-io_2.13` | Maven | From 3.13.0-M1 | 3.13.0-M7 |
| `co.fs2:fs2-io_2.13` | Maven | From 3.13.0-M1 | 3.13.0-M7 |
| `co.fs2:fs2-io_2.13.0-M5` | Maven | All versions | None |
| `co.fs2:fs2-io_2.13.0-M5` | Maven | All versions | None |
| `co.fs2:fs2-io_3` | Maven | All versions | 2.5.13 |
| `co.fs2:fs2-io_3` | Maven | All versions | 2.5.13 |
| `co.fs2:fs2-io_3` | Maven | From 3.0.0-M1 | 3.12.2 |
| `co.fs2:fs2-io_3` | Maven | From 3.0.0-M1 | 3.12.2 |
| `co.fs2:fs2-io_3` | Maven | From 3.13.0-M1 | 3.13.0-M7 |
| `co.fs2:fs2-io_3` | Maven | From 3.13.0-M1 | 3.13.0-M7 |

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

Upgrade co.fs2:fs2-io_2.12 to a fixed version for your release line: 2.5.13, 3.12.2 or 3.13.0-M7.

## Is CVE-2025-58369 being exploited?

There is no known exploitation of CVE-2025-58369 in the wild and no public exploit code.

## Fix prompt for AI coding agents

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

What it is: CVE-2025-58369 is a medium-severity denial of service vulnerability in typelevel fs2, published on 5 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-58369 in the wild and no public exploit code.

Affected packages and fixed versions:
- co.fs2:fs2-io_2.12 (Maven): affected all versions; fixed in 2.5.13
- co.fs2:fs2-io_2.12 (Maven): affected all versions; fixed in 2.5.13
- co.fs2:fs2-io_2.12 (Maven): affected from 3.0.0-M1; fixed in 3.12.2
- co.fs2:fs2-io_2.12 (Maven): affected from 3.0.0-M1; fixed in 3.12.2
- co.fs2:fs2-io_2.12 (Maven): affected from 3.13.0-M1; fixed in 3.13.0-M7
- co.fs2:fs2-io_2.12 (Maven): affected from 3.13.0-M1; fixed in 3.13.0-M7
- co.fs2:fs2-io_0.26 (Maven): affected all versions; no fix listed
- co.fs2:fs2-io_0.26 (Maven): affected all versions; no fix listed
- co.fs2:fs2-io_0.27 (Maven): affected all versions; no fix listed
- co.fs2:fs2-io_0.27 (Maven): affected all versions; no fix listed
- co.fs2:fs2-io_2.11 (Maven): affected all versions; no fix listed
- co.fs2:fs2-io_2.11 (Maven): affected all versions; no fix listed

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

## Sources

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

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