CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-119793

CVE-2026-119793: Unbounded Topic Map Allocation Denial of Service in js-libp2p GossipSub

Amit Schendel
Amit Schendel
Senior Security Researcher

Nov 17, 2026·12 min read·3 visits

Executive Summary (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.

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.

Vulnerability Overview

The @libp2p/gossipsub package provides the TypeScript/JavaScript implementation of the GossipSub publish-subscribe protocol within the js-libp2p modular networking stack. GossipSub constructs a hybrid mesh and gossip overlay network where participating nodes route messages based on topic subscriptions. To maintain routing state and determine which connected peers should receive published messages or control grafts, each node maintains an in-memory directory of all active topics and the peer identifiers subscribed to them.

In versions of @libp2p/gossipsub prior to 17.0.0 (bundled in js-libp2p versions prior to 3.3.9), the protocol handler responsible for processing incoming subscription RPC frames fails to bound the total number of distinct topic entries or total topic string bytes a single remote peer can register. By default, when a remote peer transmits a subscription request for a topic string that does not yet exist on the local node, the local node immediately allocates a new entry in its primary this.topics map (Map<TopicStr, Set<PeerIdStr>>).

This design exposes an asymmetric resource consumption flaw classified under CWE-400 (Uncontrolled Resource Consumption) and CWE-770 (Allocation of Resources Without Limits or Throttling). Because subscription metadata in GossipSub is not cryptographically signed and requires no application-layer authorization by default, any remote peer capable of establishing a libp2p stream on the GossipSub protocol ID can arbitrarily inflate the victim node's memory footprint.

Sustained exploitation results in complete Denial of Service (DoS) of the target process. As the this.topics map accumulates millions of distinct keys and Set instances, the underlying Node.js or browser V8 JavaScript engine exhausts its maximum heap allocation and terminates with an unhandled Out-Of-Memory (OOM) fatal error. Furthermore, if the attacking peer disconnects prior to an OOM crash, the synchronous cleanup routine iterates over the entirety of this.topics, locking the single-threaded JavaScript event loop and stalling all network I/O.

Root Cause Analysis

The root cause of CVE-2026-119793 resides in the state management logic inside packages/gossipsub/src/gossipsub.ts, specifically within the handleReceivedSubscription method and its interaction with RPC decoding limits and peer scoring mechanics. When a peer connects and negotiates the GossipSub protocol stream, it exchanges protobuf-encoded RPC frames containing arrays of SubOpts messages (each consisting of a boolean subscribe flag and a topicid string).

During ingress processing, the decodeRpc function enforces a per-frame limit via maxSubscriptions (defaulting to 5000). However, this parameter only restricts the number of subscription entries permitted inside a single protobuf RPC message frame. It maintains no state across consecutive RPC frames transmitted over the same stream. Consequently, an adversary can send an endless sequence of RPC frames, each containing up to 5,000 unique topic strings, without triggering frame-level rejection.

Once decoded, each subscription instruction is passed to handleReceivedSubscription(from: PeerId, topic: TopicStr, subscribe: boolean). If this.allowedTopics is not explicitly configured by the application developer—which defaults to null (accepting all topics)—the method looks up the provided topic string in this.topics. When the string is not found and subscribe is true, the method instantiates a new Set, inserts it into this.topics keyed by the attacker-supplied topic string, and adds the string representation of the sender's PeerId (from.toString()) to that Set.

Additionally, the GossipSub v1.1 peer scoring model ($P_1$ through $P_7$) tracks peer behavior regarding mesh message delivery rates, first-message deliveries, mesh failures, and invalid application messages, but includes no parameter or penalty weight for subscription volume or churn. Even if a peer registers millions of fake topics, its peer score remains unaffected, preventing the node from disconnecting or graylisting the offending peer.

Finally, the secondary CPU exhaustion vector is rooted in the removePeer teardown logic and the unsubscribe branch of handleReceivedSubscription. Prior to the patch, unsubscribing a peer deleted the peer ID from topicSet (topicSet.delete(from.toString())) without deleting the key from this.topics when topicSet.size reached zero, leaving empty Set objects permanently allocated in the map until a peer disconnected. Upon disconnection, removePeer executed a linear scan (for (const [topic, peers] of this.topics)) over every registered topic in the map to remove the peer ID and prune empty sets, turning connection teardown into an $O(N)$ blocking operation proportional to the total number of unique topics ever created.

Code Analysis

The vulnerability was remediated in commit d5534174d8b7d23ac1bd45a7e738664fbfb0cf4c (Pull Request #3593) by introducing deterministic per-peer memory accounting for topic subscriptions. In packages/gossipsub/src/constants.ts, the maintainers defined two new constants to model the heap footprint of map entries:

// Default per-peer memory budget: 1 MiB
export const GossipsubMaxTopicBytesPerPeer = 1024 * 1024 // 1 MiB
 
// Fixed heap overhead per subscription entry (Map slot, Set instance, PeerId string)
export const GossipsubTopicEntryOverhead = 1024 // 1 KiB

By charging a fixed overhead of 1,024 bytes (GossipsubTopicEntryOverhead) in addition to the raw character length of the topic string (topic.length), the accounting logic bounds both total byte consumption and total entry count. Even if a peer sends 1-byte topic names, the 1 KiB overhead ensures a single peer cannot register more than approximately 1,000 topics under the default 1 MiB (GossipsubMaxTopicBytesPerPeer) limit.

In packages/gossipsub/src/gossipsub.ts, the GossipSub class was updated to maintain a running tally of consumed subscription bytes per peer via private readonly peerTopicBytes = new Map<PeerIdStr, number>(). Compare the vulnerable implementation of handleReceivedSubscription with the patched version:

// --- VULNERABLE CODE (< 17.0.0) ---
private handleReceivedSubscription (from: PeerId, topic: TopicStr, subscribe: boolean): void {
  this.log('subscription update from %p topic %s', from, topic)
 
  let topicSet = this.topics.get(topic)
 
  if (subscribe) {
    if (topicSet == null) {
      topicSet = new Set()
      // Unbounded allocation: any new topic string creates a permanent Map entry
      this.topics.set(topic, topicSet)
    }
 
    // subscribe peer to new topic
    topicSet.add(from.toString())
  } else if (topicSet != null) {
    // unsubscribe from existing topic
    // Bug: Empty topicSet is not deleted from this.topics here
    topicSet.delete(from.toString())
  }
}
// --- PATCHED CODE (>= 17.0.0) ---
private handleReceivedSubscription (from: PeerId, topic: TopicStr, subscribe: boolean): boolean {
  this.log('subscription update from %p topic %s', from, topic)
 
  const fromStr = from.toString()
  let topicSet = this.topics.get(topic)
 
  // Calculate entry cost: string length + 1024 bytes fixed overhead
  const cost = topic.length + constants.GossipsubTopicEntryOverhead
 
  if (subscribe) {
    // 1. Idempotency check: prevent double-charging on repeated SUBSCRIBE
    if (topicSet?.has(fromStr) === true) {
      return true
    }
 
    // 2. Enforce per-peer topic byte budget
    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)
 
    if (topicSet == null) {
      topicSet = new Set()
      this.topics.set(topic, topicSet)
    }
 
    // subscribe peer to new topic
    topicSet.add(fromStr)
  } else if (topicSet?.has(fromStr) === true) {
    // 3. Verified unsubscribe: only refund if peer was actually subscribed
    topicSet.delete(fromStr)
    this.peerTopicBytes.set(fromStr, Math.max(0, (this.peerTopicBytes.get(fromStr) ?? 0) - cost))
    // 4. Immediate cleanup of empty topic sets on unsubscribe
    if (topicSet.size === 0) {
      this.topics.delete(topic)
    }
  }
 
  return true
}

> [!NOTE] > The patched method changes its return signature from void to boolean. In the caller handleReceivedRpc, if handleReceivedSubscription returns false, subsequent processing (such as emitting subscription-change events or evaluating mesh grafts for that topic) is immediately aborted for that entry.

Three critical edge cases are addressed in this patch:

  1. Idempotency: Checking topicSet?.has(fromStr) === true before charging prevents benign or malicious peers from exhausting their own quota by re-sending duplicate SUBSCRIBE messages for the same topic.
  2. Refund Integrity: Checking else if (topicSet?.has(fromStr) === true) on unsubscribe ensures an attacker cannot send UNSUBSCRIBE requests for arbitrary unsubscribed topics to drive their peerTopicBytes counter down and bypass the cap.
  3. Disconnection Cleanup: In removePeer, the patch adds this.peerTopicBytes.delete(id) so the accounting map itself is cleaned up when the peer disconnects.

Exploitation

Exploiting CVE-2026-119793 requires only network reachability to a target libp2p node's listening transport (such as TCP, WebSockets, WebRTC, or QUIC) and the ability to complete a standard libp2p connection handshake (Noise or TLS) and multistream-select negotiation for /meshsub/1.1.0 or /meshsub/1.0.0. No application-level credentials, pre-shared keys (unless the entire libp2p swarm uses a private network protector), or cryptographic signatures on the subscription payloads are required.

An attacker executes the attack through the following sequence:

  1. Connection Establishment: The attacker dials the target node and opens a bidirectional stream on the GossipSub protocol.
  2. Batch Construction: The attacker constructs RPC protobuf messages where the subscriptions repeated field contains up to 5,000 SubOpts entries (subscribe: true), each populated with a unique pseudo-random string or a large payload string.
  3. Continuous Streaming: The attacker writes these RPC frames continuously over the stream. Because each subscription costs the attacker only the wire bandwidth of the protobuf frame while forcing the target to allocate persistent V8 heap structures (Map bucket entries, Set objects, and string representations), memory grows linearly on the target.
  4. Subscribe/Unsubscribe Churn (Pre-Patch Variant): Even if an attacker sends subscribe: true followed by subscribe: false in pre-17.0.0 versions, the vulnerable code failed to delete empty Set instances from this.topics during UNSUBSCRIBE handling, still leaking the Map key and empty Set object until peer disconnection.
  5. Connection Teardown Trigger: If the attacker closes the connection after registering hundreds of thousands of topics (before triggering an OOM crash), removePeer executes synchronously on the target's main thread to iterate across this.topics, freezing the Node.js event loop and causing health checks, consensus heartbeats, or other peer streams to time out.

Unit tests included in the patch commit (packages/gossipsub/test/subscription-byte-cap.spec.ts) demonstrate the exact mechanics of budget boundaries and attempted cap-bypass techniques:

// Excerpt illustrating attempted cap bypass via uncharged unsubscribes
// Attempting to unsubscribe from topics never subscribed to must not grant extra budget
const unchargedUnsub = [
  { subscribe: false, topic: 'never-subscribed-1' },
  { subscribe: false, topic: 'never-subscribed-2' }
]
// Followed by subscriptions exceeding maxTopicBytesPerPeer (1 MiB)

In vulnerable versions, all such subscriptions are unconditionally accepted into this.topics. In version 17.0.0 and later, once used + cost > this.maxTopicBytesPerPeer evaluates to true, the node drops all subsequent subscriptions from that peer while keeping existing valid subscriptions intact.

Impact Assessment

CVE-2026-119793 carries a CVSS v3.1 base score of 7.5 (High) with the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. The impact is strictly confined to system availability (A:H), with no direct impact on confidentiality (C:N) or data integrity (I:N). Because decentralized peer-to-peer networks (such as Ethereum consensus clients like Lodestar, IPFS nodes, and decentralized storage or messaging networks built on js-libp2p) rely on open peer discovery and accept inbound connections from arbitrary peers on the public internet, the attack surface is directly exposed.

When a vulnerable node is targeted, the primary consequence is process termination due to V8 heap exhaustion (FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory). In production environments without automated process supervisors, the node remains offline permanently. In environments with container orchestrators (such as Kubernetes or systemd auto-restart), the attacker can repeatedly crash the node immediately after startup as soon as it rejoins the DHT or peer exchange, creating a persistent denial-of-service loop.

Even before the V8 heap limit is reached, increasing heap pressure forces the V8 garbage collector into frequent, expensive full mark-compact cycles. Combined with the synchronous iteration over this.topics during removePeer, the Node.js event loop experiences severe latency spikes. For time-sensitive protocols—such as blockchain validators required to attest or propose blocks within strict slot intervals (e.g., 12-second slots)—event loop starvation causes missed duties, degraded network participation, and potential economic slashing or inactivity penalties.

Remediation & Fix Completeness

To remediate CVE-2026-119793, operators and developers must upgrade @libp2p/gossipsub to version 17.0.0 or later, and js-libp2p to version 3.3.9 or later. In version 17.0.0, maxTopicBytesPerPeer is enabled by default and set to 1048576 bytes (1 MiB), requiring no manual configuration changes to protect against single-peer subscription flooding.

For applications that operate on a fixed, known set of topics, developers can further harden their nodes by configuring both allowedTopics (which restricts the node to tracking only explicitly whitelisted topic strings) and tuning maxTopicBytesPerPeer to match their protocol's exact requirements:

import { gossipsub } from '@libp2p/gossipsub'
 
const pubsub = gossipsub({
  // Strictly whitelist known application topics
  allowedTopics: [
    '/myapp/1.0.0/blocks',
    '/myapp/1.0.0/transactions'
  ],
  // Optionally lower the per-peer topic budget from the 1 MiB default (e.g., to 64 KiB)
  maxTopicBytesPerPeer: 64 * 1024
})

Fix Completeness and Residual Risks

While commit d5534174d8b7d23ac1bd45a7e738664fbfb0cf4c completely resolves the unbounded single-peer allocation flaw and fixes the empty Set leak on UNSUBSCRIBE, security engineers should account for two architectural boundaries in the current fix:

  1. Multi-Peer (Sybil) Amplification: The budget enforced by maxTopicBytesPerPeer is tracked per PeerId (this.peerTopicBytes), and there is no global cap on the aggregate size of this.topics across all connected peers. Because generating libp2p keypairs (PeerIds) is computationally inexpensive, an adversary capable of opening $N$ concurrent connections using distinct PeerIds can consume up to $N \times 1\text{ MiB}$ of topic map memory. Mitigating this residual vector requires enforcing strict connection limits at the libp2p transport and connection manager layers (maxConnections, inbound connection rate limiting, and per-IP/subnet limits).
  2. Absence of Behavioral Penalties: When a peer exceeds maxTopicBytesPerPeer, handleReceivedSubscription logs a debug message and ignores the subscription, but does not apply a negative peer score penalty or disconnect the peer. The offending peer can maintain its connection and keep its 1 MiB allocation occupied indefinitely until the connection is closed.

Official Patches

libp2pGitHub Security Advisory GHSA-x2vm-cf3p-m2w8
libp2pPull Request #3593 implementing per-peer subscription byte cap
libp2pPrimary remediation commit in js-libp2p
libp2p@libp2p/gossipsub v17.0.0 Release

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected Systems

@libp2p/gossipsubjs-libp2p

Affected Versions Detail

Product
Affected Versions
Fixed Version
@libp2p/gossipsub
libp2p
< 17.0.017.0.0
js-libp2p
libp2p
< 3.3.93.3.9
AttributeDetail
CVE IDCVE-2026-119793 (GHSA-x2vm-cf3p-m2w8)
Weakness ClassCWE-400 (Uncontrolled Resource Consumption) / CWE-770
CVSS v3.1 Score7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)
Attack VectorNetwork (Unauthenticated P2P GossipSub RPC Stream)
Primary ImpactDenial of Service via V8 Heap OOM & Event Loop CPU Starvation
Affected Component@libp2p/gossipsub (< 17.0.0) / js-libp2p (< 3.3.9)
Exploit StatusProof-of-Concept in unit test suite
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-400
Uncontrolled Resource Consumption

The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.

Vulnerability Timeline

Fix committed (d5534174d8b7d23ac1bd45a7e738664fbfb0cf4c) and merged via PR #3593
2026-08-13
CVE-2026-119793 and GHSA-x2vm-cf3p-m2w8 published
2026-11-17
NVD assessment published with CVSS v3.1 score of 7.5
2026-11-17

References & Sources

  • [1]GitHub Security Advisory: GHSA-x2vm-cf3p-m2w8
  • [2]GitHub Pull Request #3593
  • [3]Remediation Commit d5534174d8b7d23ac1bd45a7e738664fbfb0cf4c
  • [4]Release gossipsub-v17.0.0
  • [5]Official CVE Record: CVE-2026-119793
  • [6]NVD Vulnerability Detail: CVE-2026-119793
  • [7]CISA Known Exploited Vulnerabilities Catalog

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•11 minutes ago•CVE-2026-110789
7.5

CVE-2026-110789: Pre-Authentication Denial of Service via ASN.1 DER Length Parsing in js-libp2p (@libp2p/crypto)

CVE-2026-110789 (GHSA-rvfr-cqwq-rc4j) is a high-severity pre-authentication Denial of Service (DoS) vulnerability in the @libp2p/crypto package of the js-libp2p networking stack prior to version 5.1.22. An improper length validation flaw in the ASN.1 DER decoder allows an unauthenticated remote peer to send a crafted RSA public key during the Identify protocol exchange, forcing the parser into a synchronous loop over attacker-claimed length values. Because this loop executes within a single Node.js event-loop tick prior to identity or cryptographic signature verification, it bypasses application timeouts, stalls the event loop for 4 to 5 seconds per connection, and transiently allocates up to 2 GB of memory.

Amit Schendel
Amit Schendel
0 views•11 min read
•about 2 hours ago•CVE-2026-69241
5.4

CVE-2026-69241: Stored Cross-Site Scripting via Unsanitized SVG Upload in Filament Curator

Filament Curator, a media picker plugin for Filament panels in Laravel applications, contains a Stored Cross-Site Scripting (XSS) vulnerability in versions prior to 3.7.9, 4.1.2, and 5.1.2. The application accepts image/svg+xml uploads by default and stores them on disk without stripping executable XML markup. When a panel user opens an uploaded SVG via the View action, the file renders as a top-level document in the browser, executing embedded JavaScript within the origin of the Filament application.

Alon Barad
Alon Barad
3 views•9 min read
•about 5 hours ago•CVE-2026-63182
8.1

CVE-2026-63182: XML Signature Wrapping Authentication Bypass in LightSAML

CVE-2026-63182 is a high-severity XML Signature Wrapping (XSW) vulnerability in LightSAML (litesaml/lightsaml), a PHP library implementing SAML 2.0 data models and cryptographic verification. An architectural discrepancy between how LightSAML deserializes direct child assertions and how the underlying robrichards/xmlseclibs library resolves XML document fragment identifiers allows an attacker with a valid signed assertion to forge arbitrary SAML identity claims and bypass authentication.

Alon Barad
Alon Barad
4 views•11 min read
•about 6 hours ago•CVE-2026-119351
6.3

CVE-2026-119351: Cross-Context Cache Leak via Delayed Inner Stream Metadata in Next.js

A race condition and improper synchronization vulnerability (CWE-362) exists in Next.js versions 16.2.0 prior to 16.4.5 when Cache Components ('use cache' directive) are enabled. When an outer cached function calls a nested cached function that reads dynamic root parameters via 'next/root-params' and returns an object containing pending promises, React Flight can resolve and deliver the ready portion of the payload before the inner cache finishes publishing its root parameter dependencies. Consequently, the outer cache entry finalizes and persists under a cache key that omits the root parameter dependencies, causing the first written cache entry to be served across requests with different root parameter values and bypassing nested cache invalidation rules.

Amit Schendel
Amit Schendel
7 views•10 min read
•about 7 hours ago•CVE-2026-68934
8.7

CVE-2026-68934: OS Command Injection in code-review-mcp-server via Unsafe Shell Execution

A remote OS command injection vulnerability (CWE-78) exists in code-review-mcp-server prior to version 1.5.3. The application passes caller-controlled tool parameters directly into Node.js child_process.execSync() calls without proper neutralization. An attacker or compromised LLM agent invoking tools such as getLocalGitDiff, codeReview, createPR, or getPRTemplate can inject arbitrary shell commands that execute with the privileges of the MCP server host process.

Alon Barad
Alon Barad
10 views•11 min read
•about 8 hours ago•CVE-2026-86046
7.1

CVE-2026-86046: Arbitrary File Write via Path Traversal in termux-sync Restore Workflow

A path traversal vulnerability (CWE-22) in termux-sync prior to version 1.2.4 allows an attacker to overwrite arbitrary files within the Termux environment during the backup restoration process. The flaw stems from the application trusting attacker-controlled extraction paths defined in the backup's manifest.json file, failing to validate archive members against directory traversal sequences during tar extraction, and using unsanitized backup names when constructing temporary directories. If a user restores a malicious backup archive from local storage, shared folders, GitHub, or Google Drive, an attacker can overwrite sensitive configuration files such as shell startup scripts or local binaries, resulting in arbitrary code execution under the privileges of the Termux user.

Amit Schendel
Amit Schendel
6 views•11 min read