{"vuln_id":"GHSA-x2vm-cf3p-m2w8","aliases":["CVE-2026-119793"],"description":"libp2p: gossipsub creates a permanent topics-map entry per distinct subscription with no cap in the default config","published_at":"2026-11-17T21:06:20Z","modified_at":"2026-11-17T21:06:20Z","first_seen_at":"2026-11-21T19:15:20.172180Z","severity":"high","severity_source":"ghsa","cvss_score":7.5,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","cwe":["CWE-400","CWE-770"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-x2vm-cf3p-m2w8"},"matched_alias":null,"items":[{"id":2452,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-x2vm-cf3p-m2w8 / CVE-2026-119793: libp2p: gossipsub creates a permanent topics-map entry per distinct subscription with no cap in the default config","summary":"libp2p: gossipsub creates a permanent topics-map entry per distinct subscription with no cap in the default config\n\n### Summary\nA single gossipsub peer can grow a node's `topics` map without bound by flooding subscription RPCs, because the default configuration has no global, per-peer, or topic-length cap and peer scoring does not penalise subscription volume. The peer is never greylisted, so the growth continues toward OOM.\n\n### Details\n`handleReceivedSubscription` (`packages/gossipsub/src/gossipsub.ts:1028`, line 1036) runs `this.topics.set(topic, new Set())` for every distinct topic string:\n\n```ts\nprivate handleReceivedSubscription (from, topic, subscribe) {\n  let topicSet = this.topics.get(topic)\n  if (subscribe) {\n    if (topicSet == null) {\n      topicSet = new Set()\n      this.topics.set(topic, topicSet)   // no global cap, no per-peer cap\n    }\n    topicSet.add(from.toString())\n  }\n}\n```\n\nThe only topical gate (`gossipsub.ts:981`, `if (this.allowedTopics != null && !this.allowedTopics.has(topic)) return`) is skipped when `allowedTopics` is null — the default. Subscriptions are unsigned RPC metadata (no signature needed); `decodeRpc`'s per-RPC limit caps count (`maxSubscriptions = 5000`) but not topic-string length or aggregate size; and the peer-scoring components P1–P7 have no subscription-volume term, so the attacker's score stays at 0 (above the `graylistThreshold` of −80) and `acceptFrom` keeps returning true. Verified on js-libp2p commit `a04f5e0`, where `@libp2p/gossipsub` reads `16.0.4`.\n\n### PoC\nFull PoC attached (`gossipsub-topics-unbounded-growth-poc.tar.gz`). Build the js-libp2p monorepo at the affected version (`npm install --ignore-scripts && npm run build`), extract the package inside the monorepo root (sibling of `packages/`), then `cd gossipsub-topics-unbounded-growth-poc && node attack.mjs`. Expected (default config):\n\n```\n[*] sending 300 RPC frames x 4000 unique ~190-byte topic subscriptions (1,200,000 topics total)\n[*]   progress: 88% sent | victim topics=1,032,000 rss=740MB peers=1\n[*] victim quiesced: topics=~1,100,000 rss=~870MB peers=1\n[!] Vulnerability reproduced: one connected peer grew the victim's gossipsub topics map to ~1.1M entries (RSS +~900MB) with 300 subscription RPCs — no global, per-peer, or topic-length cap in the default config\n```\n\nControl run (`ALLOWED_TOPICS=legit-topic`, i.e. `node attack.mjs control`): the identical flood is rejected at the `allowedTopics` gate and the topics map stays at 0 entries — confirming the vulnerable condition is the default `allowedTopics`-unset config. The map grows monotonically with no cap until the victim's own resource pressure trips; on disconnect `removePeer` performs an O(N) sweep over every topic entry (a secondary CPU cost) while the ~1 GB heap stays committed.\n\n### Impact\nCWE-400/CWE-770. Every node running default gossipsub is affected; the attacker needs only one connection and is never rate-limited or greylisted. Growth continues toward OOM; on disconnect the O(N) `removePeer` sweep adds CPU cost. Suggested fix: bound by default (not opt-in) — a global cap on `topics.si\n\nAffected packages: npm:@libp2p/gossipsub\nPatched: @libp2p/gossipsub 17.0.0","url":"https://github.com/advisories/GHSA-x2vm-cf3p-m2w8","published_at":"2026-11-17T21:06:20Z","updated_at":"2026-11-17T21:06:20Z","fetched_at":"2026-11-21T19:15:18.416847Z","severity":"high","cvss_score":7.5,"epss":0.00623,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"@libp2p/gossipsub","vuln_id":"CVE-2026-119793","vuln_ids":["CVE-2026-119793","GHSA-X2VM-CF3P-M2W8"],"tags":["ghsa","npm","CWE-400","CWE-770"],"cluster_id":2346,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2452","html":"https://vulnwatch.ve1ve2.com/item/2452"}},{"id":6595,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-119793: libp2p is a JavaScript implementation of the libp2p networking stack. Prior to 17.0.0, the @libp2p/gossipsub default configuration allows a connected remote pe…","summary":"libp2p is a JavaScript implementation of the libp2p networking stack. Prior to 17.0.0, the @libp2p/gossipsub default configuration allows a connected remote peer to submit unsigned subscription RPC metadata for arbitrarily many distinct topic strings. handleReceivedSubscription in packages/gossipsub/src/gossipsub.ts creates a persistent topics-map entry for each accepted topic, while allowedTopics is unset by default, decodeRpc maxSubscriptions limits only one RPC rather than aggregate topic bytes, and peer scoring has no subscription-volume penalty. A single peer can therefore grow the topics map and committed heap toward out-of-memory conditions, and disconnecting additionally causes removePeer to scan all accumulated topic entries. This issue is fixed in version 17.0.0.\n\nReferences:\nhttps://github.com/libp2p/js-libp2p/commit/d5534174d8b7d23ac1bd45a7e738664fbfb0cf4c\nhttps://github.com/libp2p/js-libp2p/pull/3593\nhttps://github.com/libp2p/js-libp2p/releases/tag/gossipsub-v17.0.0\nhttps://github.com/libp2p/js-libp2p/security/advisories/GHSA-x2vm-cf3p-m2w8\nhttps://github.com/libp2p/js-libp2p/security/advisories/GHSA-x2vm-cf3p-m2w8","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-119793","published_at":"2026-11-17T19:17:46.530000Z","updated_at":"2026-11-18T17:17:29.417000Z","fetched_at":"2026-11-21T19:15:31.482396Z","severity":"high","cvss_score":7.5,"epss":0.00623,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-119793","vuln_ids":["CVE-2026-119793","GHSA-X2VM-CF3P-M2W8"],"tags":["CWE-400","CWE-770"],"cluster_id":2347,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/6595","html":"https://vulnwatch.ve1ve2.com/item/6595"}}]}