# CVE-2023-39533: libp2p nodes vulnerable to attack using large RSA keys

> A malicious peer can cause resource exhaustion and denial of service in go-libp2p nodes by using large RSA keys during handshake verification.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/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:** 8 Aug 2023
- **Updated:** 1 Sep 2026
- **Also known as:** AZL-27872, AZL-27875, AZL-37359, AZL-37422, AZL-52773, AZL-79074, AZL-98640, GHSA-876p-8259-xjgg, GO-2023-2000

## What is CVE-2023-39533?

CVE-2023-39533 is a high-severity denial of service vulnerability in go-libp2p, published on 8 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

go-libp2p is the Go implementation of the libp2p Networking Stack. Prior to versions 0.27.8, 0.28.2, and 0.29.1 malicious peer can use large RSA keys to run a resource exhaustion attack & force a node to spend time doing signature verification of the large key. This vulnerability is present in the core/crypto module of go-libp2p and can occur during the Noise handshake and the libp2p x509 extension verification step. To prevent this attack, go-libp2p versions 0.27.8, 0.28.2, and 0.29.1 restrict RSA keys to <= 8192 bits. To protect one's application, it is necessary to update to these patch releases and to use the updated Go compiler in 1.20.7 or 1.19.12. There are no known workarounds for this issue.

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling)

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

7 open source packages ship an affected version, including github.com/libp2p/go-libp2p. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/libp2p/go-libp2p` | Go | All versions | 0.27.8, 0.28.2, 0.29.1 |
| `github.com/libp2p/go-libp2p` | Go | All versions | 0.27.8 |
| `github.com/libp2p/go-libp2p` | Go | All versions | 0.27.8 |
| `github.com/libp2p/go-libp2p` | Go | From 0.28.0 | 0.28.2 |
| `github.com/libp2p/go-libp2p` | Go | From 0.28.0 | 0.28.2 |
| `github.com/libp2p/go-libp2p` | Go | From 0.29.0 | 0.29.1 |
| `github.com/libp2p/go-libp2p` | Go | From 0.29.0 | 0.29.1 |

Products: Libp2p Go-Libp2p.

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

Upgrade github.com/libp2p/go-libp2p to a fixed version for your release line: 0.27.8, 0.28.2 or 0.29.1.

## Is CVE-2023-39533 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2023-39533 is a high-severity denial of service vulnerability in go-libp2p, published on 8 Aug 2023. 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-2023-39533 exists.

Affected packages and fixed versions:
- github.com/libp2p/go-libp2p (Go): affected all versions; fixed in 0.27.8, 0.28.2, 0.29.1
- github.com/libp2p/go-libp2p (Go): affected all versions; fixed in 0.27.8
- github.com/libp2p/go-libp2p (Go): affected all versions; fixed in 0.27.8
- github.com/libp2p/go-libp2p (Go): affected from 0.28.0; fixed in 0.28.2
- github.com/libp2p/go-libp2p (Go): affected from 0.28.0; fixed in 0.28.2
- github.com/libp2p/go-libp2p (Go): affected from 0.29.0; fixed in 0.29.1
- github.com/libp2p/go-libp2p (Go): affected from 0.29.0; fixed in 0.29.1

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

## Sources

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

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