Skip to main content
Vulnerability Database/CVE-2026-95859

CVE-2026-95859: libp2p-rust Gossipsub DOS Vulnerability

CVE-2026-95859 is a denial of service vulnerability in libp2p-rust Gossipsub that allows attackers to exhaust process memory through malicious GRAFT messages. This article covers the technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-95859 Overview

CVE-2026-95859 is an unbounded resource allocation vulnerability [CWE-770] in rust-libp2p, the official Rust implementation of the libp2p peer-to-peer networking stack. The flaw resides in the Gossipsub protocol's GRAFT control-message handler, which adds attacker-supplied topic hashes to connected_peer.topics without verifying prior subscription. A remote, unauthenticated peer can repeatedly send GRAFT messages with novel topic hashes to exhaust process memory. All versions prior to 0.49.5 are affected.

Critical Impact

A single unauthenticated remote peer can trigger per-peer memory growth that bypasses subscription filters, peer scoring, and per-message size limits, leading to denial of service on any node running a vulnerable Gossipsub listener.

Affected Products

  • rust-libp2p library versions prior to 0.49.5
  • libp2p-gossipsub crate versions 0.49.4 and earlier
  • Any Rust application or node embedding Gossipsub for peer-to-peer messaging

Discovery Timeline

  • 2026-10-16 - CVE-2026-95859 published to the National Vulnerability Database
  • 2026-10-21 - Last updated in NVD database

Technical Details for CVE-2026-95859

Vulnerability Analysis

Gossipsub is the pub/sub protocol used by libp2p for scalable, topic-based messaging across peer-to-peer networks. The protocol defines GRAFT control messages that peers exchange to join a topic's full-message mesh after already subscribing.

In vulnerable versions, the handler blindly inserts every topic hash present in an inbound GRAFT message into the local connected_peer.topics map tracking that peer. No check validates that the peer previously announced a SUBSCRIBE for the topic. Because topic hashes are 32-byte values with an effectively unbounded namespace, an attacker can mint fresh hashes indefinitely.

Existing Gossipsub safeguards do not contain the growth. Subscription filters only govern outbound traffic, peer scoring reacts after metrics accumulate, and per-message size limits apply individually rather than cumulatively.

Root Cause

The root cause is missing authorization state validation in the GRAFT handling path. Trust in attacker-controlled input causes unbounded growth of a per-peer data structure, matching the pattern of [CWE-770: Allocation of Resources Without Limits or Throttling].

Attack Vector

Exploitation requires only network reachability to a Gossipsub listener. The attacker opens a libp2p connection, performs the standard Gossipsub handshake, and then streams GRAFT control messages containing unique, never-subscribed topic hashes. Each message permanently enlarges the victim's per-peer topic set until the process is terminated by the operating system's out-of-memory killer.

text
[[package]]
 name = "libp2p-gossipsub"
-version = "0.49.4"
+version = "0.49.5"
 dependencies = [
  "async-channel",
  "asynchronous-codec",

Source: rust-libp2p commit 51ed5f0. The patch bumps libp2p-gossipsub from 0.49.4 to 0.49.5, where GRAFT handling now rejects topics the peer has not subscribed to.

Detection Methods for CVE-2026-95859

Indicators of Compromise

  • Sustained resident memory growth in a rust-libp2p process without a corresponding increase in legitimate message throughput.
  • Repeated inbound GRAFT control messages from a single peer referencing topic hashes that were never preceded by a SUBSCRIBE.
  • connected_peer.topics cardinality growing without bound for one or more remote peers.

Detection Strategies

  • Instrument Gossipsub with metrics that count GRAFT messages per peer and compare against the set of SUBSCRIBE messages received from the same peer.
  • Alert when the number of tracked topics per peer exceeds a reasonable upper bound tied to the application's expected topic namespace.
  • Correlate process memory telemetry with libp2p connection counts to flag disproportionate growth.

Monitoring Recommendations

  • Export Gossipsub Prometheus metrics (topic_peers, mesh_peers) and chart them per remote peer identity.
  • Monitor host-level RSS and OOM-killer events for processes running libp2p nodes.
  • Capture packet-level traces during memory-growth incidents to attribute anomalies to specific peer IDs.

How to Mitigate CVE-2026-95859

Immediate Actions Required

  • Upgrade libp2p-gossipsub to version 0.49.5 or later and rebuild all dependent binaries.
  • Audit deployed Rust applications and nodes for transitive dependencies on vulnerable rust-libp2p versions.
  • Restart long-running libp2p processes after patching to clear any accumulated per-peer topic state.

Patch Information

The fix is delivered in libp2p-gossipsub0.49.5 via GitHub Pull Request #6608 and merged in commit 51ed5f0. Full remediation details are published in GitHub Security Advisory GHSA-g3g5-x568-qvqx.

Workarounds

  • Restrict inbound libp2p connections to a trusted peer allowlist until the patch can be deployed.
  • Enforce aggressive peer scoring thresholds that disconnect peers producing excessive GRAFT traffic.
  • Place a process-level memory cgroup limit around the libp2p process to force a controlled restart instead of host-wide impact.
bash
# Update Cargo.toml to pull the patched release
cargo update -p libp2p-gossipsub --precise 0.49.5
cargo build --release

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.