# CVE-2026-46679: libp2p js-libp2p memory exhaustion in @libp2p/gossipsub

Source: https://junglewise.ai/threats/cve-2026-46679-libp2p-js-libp2p-memory-exhaustion-in-libp2p-gossipsub  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-10. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-46679 · Severity: high · CVSS 7.5 · Published 2026-06-10

The GossipSub component of libp2p, used for peer-to-peer message routing in decentralized networks, contains a memory exhaustion vulnerability. An attacker can send specially crafted subscription messages containing thousands of unique topics to cause a Node.js process to consume excessive memory and crash within seconds. This affects any application using the vulnerable library on a public network without authentication requirements.

Technologies: [Libp2p Gossipsub](https://junglewise.ai/threats/technologies/gossipsub), [@libp2p/gossipsub (npm)](https://junglewise.ai/threats/technologies/libp2p-gossipsub). Vendors: [Libp2p](https://junglewise.ai/threats/vendors/libp2p), [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-46679 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-46679 being exploited in the wild.

**How severe is CVE-2026-46679?** High severity, with a CVSS score of 7.5, published 10 June 2026.

**Which products and versions are affected?** Libp2p Gossipsub <= 15.0.22, <=15.0.22; @libp2p/gossipsub (npm) <= 15.0.22, SEMVER:introduced=0,fixed=15.0.23.

**Is there a fix for CVE-2026-46679?** Yes. @libp2p/gossipsub (npm): upgrade to 15.0.23 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-46679 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-46679?** Check whether you run Libp2p Gossipsub or @libp2p/gossipsub (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @libp2p/gossipsub (npm): upgrade to 15.0.23 or later

  ```sh
  npm install @libp2p/gossipsub@15.0.23
  ```


## Technical details

The vulnerability arises from three compounding issues in @libp2p/gossipsub: (1) no decode-level cap on subscription entries per RPC (defaultDecodeRpcLimits.maxSubscriptions = Infinity), allowing a single 4MB frame to carry ~349K unique SUBSCRIBE entries; (2) unbounded growth of the this.topics map with no per-peer subscription limit, creating new Map/Set entries for every unique topic string; (3) a memory leak in removePeer() that retains empty Sets after peer disconnection, making memory non-reclaimable for the process lifetime. An unauthenticated attacker can open a gossipsub stream and repeatedly send RPCs with sequential unique topic subscriptions, achieving ~22x memory amplification (4MB attacker payload → ~89MB heap consumption) per frame. A Node.js process with default 1.5GB heap limit crashes after ~17 frames (~68MB total bandwidth). Patch version 15.0.23 and later address these defects.

## Affected products

- libp2p @libp2p/gossipsub <=15.0.22

## Identifiers

- CVE-2026-46679
- GHSA-4f8r-922h-2vgv

## Timeline

- 2026-05-21: disclosed
- 2026-05-21: patched: patch version 15.0.23

## References

- [https://github.com/libp2p/js-libp2p/security/advisories/GHSA-4f8r-922h-2vgv](https://github.com/libp2p/js-libp2p/security/advisories/GHSA-4f8r-922h-2vgv)
- [https://github.com/libp2p/js-libp2p](https://github.com/libp2p/js-libp2p)

## Related threats

- [libp2p Gossipsub message authentication bypass in RSA peer IDs](https://junglewise.ai/threats/cve-2026-86038-libp2p-gossipsub-message-authentication-bypass-in-rsa-peer-ids)
- [libp2p gossipsub denial of service via oversized control messages](https://junglewise.ai/threats/cve-2026-49866-libp2p-gossipsub-denial-of-service-via-oversized-control-messages)
