CVE-2026-119793: CVE-2026-119793: Unbounded Topic Map Allocation Denial of Service in js-libp2p GossipSub
CVE-2026-119793: Unbounded Topic Map Allocation Denial of Service in js-libp2p GossipSub Vulnerability ID: CVE-2026-119793 CVSS Score: 7.5 Published: 2026-11-17 CVE-2026-119793 (GHSA-x2vm-cf3p-m2w8) is a resource co
CVE-2026-119793: Unbounded Topic Map Allocation Denial of Service in js-libp2p GossipSub
Vulnerability ID: CVE-2026-119793
CVSS Score: 7.5
Published: 2026-11-17
CVE-2026-119793 (GHSA-x2vm-cf3p-m2w8) is a resource consumption vulnerability in the @libp2p/gossipsub module of the js-libp2p ecosystem. Prior to @libp2p/gossipsub version 17.0.0 and js-libp2p version 3.3.9, the GossipSub implementation processed incoming subscription RPC messages without enforcing per-peer or global limits on the number or cumulative byte size of subscribed topics in its default configuration. An unauthenticated remote peer can exploit this flaw by streaming continuous batches of unique topic subscription strings over an established connection, causing unbounded growth of the internal topics Map. This leads to V8 heap exhaustion (Out-Of-Memory crash) and severe CPU starvation on the main event loop during peer disconnection teardown.
TL;DR
An unauthenticated remote peer can crash a js-libp2p node running @libp2p/gossipsub (< 17.0.0) by sending an unbounded number of unique topic subscription strings, exhausting V8 heap memory and blocking the Node.js event loop during peer teardown.
⚠️ Exploit Status: POC
Technical Details
- CVE ID: CVE-2026-119793 (GHSA-x2vm-cf3p-m2w8)
- Weakness Class: CWE-400 (Uncontrolled Resource Consumption) / CWE-770
- CVSS v3.1 Score: 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)
- Attack Vector: Network (Unauthenticated P2P GossipSub RPC Stream)
- Primary Impact: Denial of Service via V8 Heap OOM & Event Loop CPU Starvation
- Affected Component: @libp2p/gossipsub (< 17.0.0) / js-libp2p (< 3.3.9)
- Exploit Status: Proof-of-Concept in unit test suite
- CISA KEV Status: Not Listed
Affected Systems
- @libp2p/gossipsub
- js-libp2p
-
@libp2p/gossipsub: < 17.0.0 (Fixed in:
17.0.0) -
js-libp2p: < 3.3.9 (Fixed in:
3.3.9)
Code Analysis
Commit: d553417
Introduce per-peer topic subscription memory budget (maxTopicBytesPerPeer) and fixed entry overhead accounting in @libp2p/gossipsub
+export const GossipsubMaxTopicBytesPerPeer = 1024 * 1024 // 1 MiB
+export const GossipsubTopicEntryOverhead = 1024 // 1 KiB
+
+ private handleReceivedSubscription (from: PeerId, topic: TopicStr, subscribe: boolean): boolean {
+ const fromStr = from.toString()
+ let topicSet = this.topics.get(topic)
+ const cost = topic.length + constants.GossipsubTopicEntryOverhead
+ if (subscribe) {
+ if (topicSet?.has(fromStr) === true) {
+ return true
+ }
+ const used = this.peerTopicBytes.get(fromStr) ?? 0
+ if (used + cost > this.maxTopicBytesPerPeer) {
+ this.log('ignoring subscription from %p topic %s, over per-peer topic budget', from, topic)
+ return false
+ }
+ this.peerTopicBytes.set(fromStr, used + cost)
Mitigation Strategies
- Enforce per-peer memory accounting for topic subscriptions by upgrading to @libp2p/gossipsub >= 17.0.0.
- Configure explicit topic whitelisting using the allowedTopics configuration option in GossipSub when the set of valid protocol topics is known in advance.
- Restrict maximum concurrent inbound connections and enforce per-IP connection limits in the libp2p Connection Manager to prevent Sybil-based multi-peer memory exhaustion.
- Tune maxTopicBytesPerPeer downward from the 1 MiB default if legitimate peers only subscribe to a small number of topics.
Remediation Steps:
- Update package.json dependencies to require '@libp2p/gossipsub': '^17.0.0' and 'js-libp2p': '^3.3.9'.
- Run 'npm install' or your package manager's equivalent update command and verify the resolved version in package-lock.json or yarn.lock.
- Review GossipSub instantiation options and define 'allowedTopics' if your application uses a static set of pubsub topics.
- Verify that libp2p ConnectionManager 'maxConnections' is bounded according to host memory capacity (accounting for up to 1 MiB per peer under default GossipSub settings).
References
- GitHub Security Advisory: GHSA-x2vm-cf3p-m2w8
- GitHub Pull Request #3593
- Remediation Commit d5534174d8b7d23ac1bd45a7e738664fbfb0cf4c
- Release gossipsub-v17.0.0
- Official CVE Record: CVE-2026-119793
- NVD Vulnerability Detail: CVE-2026-119793
- CISA Known Exploited Vulnerabilities Catalog
Read the full report for CVE-2026-119793 on our website for more details including interactive diagrams and full exploit analysis.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.