# CVE-2023-25568: Boxo bitswap/server: DOS unbounded persistent memory leak

> An attacker can cause a persistent memory leak in the Boxo Bitswap server, leading to denial of service for applications accepting untrusted connections.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 May 2023
- **Updated:** 13 Feb 2025
- **Also known as:** GHSA-m974-xj4j-7qv5, GHSA-q3j6-22wf-3jh9, GO-2023-1766

## What is CVE-2023-25568?

CVE-2023-25568 is a high-severity denial of service vulnerability in ipfs boxo, published on 10 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Boxo, formerly known as go-libipfs, is a library for building IPFS applications and implementations. In versions 0.4.0 and 0.5.0, if an attacker is able allocate arbitrary many bytes in the Bitswap server, those allocations are lasting even if the connection is closed. This affects users accepting untrusted connections with the Bitswap server and also affects users using the old API stubs at `github.com/ipfs/go-libipfs/bitswap` because users then transitively import `github.com/ipfs/go-libipfs/bitswap/server`. Boxo versions 0.6.0 and 0.4.1 contain a patch for this issue. As a workaround, those who are using the stub object at `github.com/ipfs/go-libipfs/bitswap` not taking advantage of the features provided by the server can refactor their code to use the new split API that will allow them to run in a client only mode: `github.com/ipfs/go-libipfs/bitswap/client`.

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

## Which versions are affected by CVE-2023-25568?

8 open source packages ship an affected version, including github.com/ipfs/go-libipfs and github.com/ipfs/go-bitswap. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/ipfs/go-libipfs` | Go | All versions | 0.4.1, 0.6.0 |
| `github.com/ipfs/go-libipfs` | Go | All versions | 0.4.1 |
| `github.com/ipfs/go-libipfs` | Go | All versions | 0.4.1 |
| `github.com/ipfs/go-libipfs` | Go | From 0.5.0 | 0.6.0 |
| `github.com/ipfs/go-libipfs` | Go | From 0.5.0 | 0.6.0 |
| `github.com/ipfs/go-bitswap` | Go | All versions | 0.12.0 |
| `github.com/ipfs/go-bitswap` | Go | All versions | 0.12.0 |
| `github.com/ipfs/go-bitswap` | Go | All versions | 0.12.0 |

Products: Protocol Boxo.

## How do I fix CVE-2023-25568?

Upgrade github.com/ipfs/go-libipfs to a fixed version for your release line: 0.4.1 or 0.6.0.

## Is CVE-2023-25568 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-25568 and fix it if it is affected.

What it is: CVE-2023-25568 is a high-severity denial of service vulnerability in ipfs boxo, published on 10 May 2023. 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-2023-25568 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/ipfs/go-libipfs (Go): affected all versions; fixed in 0.4.1, 0.6.0
- github.com/ipfs/go-libipfs (Go): affected all versions; fixed in 0.4.1
- github.com/ipfs/go-libipfs (Go): affected all versions; fixed in 0.4.1
- github.com/ipfs/go-libipfs (Go): affected from 0.5.0; fixed in 0.6.0
- github.com/ipfs/go-libipfs (Go): affected from 0.5.0; fixed in 0.6.0
- github.com/ipfs/go-bitswap (Go): affected all versions; fixed in 0.12.0
- github.com/ipfs/go-bitswap (Go): affected all versions; fixed in 0.12.0
- github.com/ipfs/go-bitswap (Go): affected all versions; fixed in 0.12.0

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

## Sources

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

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