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

CVE-2026-34219: libp2p-rust Gossipsub RCE Vulnerability

CVE-2026-34219 is a remote code execution flaw in libp2p-rust Gossipsub that enables attackers to trigger panic via crafted PRUNE messages. This article covers technical details, affected versions, impact, and mitigation.

Published:

CVE-2026-34219 Overview

libp2p-rust is the official Rust language implementation of the libp2p networking stack. A remotely reachable panic vulnerability exists in the Gossipsub implementation's backoff expiry handling prior to version 0.49.4. When a peer sends a crafted PRUNE control message with an attacker-controlled, near-maximum backoff value, the value is accepted and stored as an Instant near the representable upper bound. On a later heartbeat, the implementation performs unchecked Instant + Duration arithmetic (backoff_time + slack), which can overflow and cause a panic with the error: "overflow when adding duration to instant."

Critical Impact

This denial of service vulnerability allows unauthenticated remote attackers to crash libp2p-rust nodes by sending crafted PRUNE control messages, potentially disrupting peer-to-peer network operations.

Affected Products

  • libp2p-rust versions prior to 0.49.4
  • Applications using rust-libp2p Gossipsub protocol
  • Peer-to-peer networks utilizing libp2p-rust for messaging

Discovery Timeline

  • 2026-03-31 - CVE CVE-2026-34219 published to NVD
  • 2026-04-01 - Last updated in NVD database

Technical Details for CVE-2026-34219

Vulnerability Analysis

This vulnerability is classified as an Integer Overflow (CWE-190) that results in a denial of service condition. The flaw exists in the Gossipsub protocol implementation's handling of PRUNE control messages, specifically in the backoff expiry calculation logic.

The Gossipsub protocol uses PRUNE messages to manage mesh membership and includes a backoff duration that tells peers how long to wait before attempting to re-graft. The vulnerable code accepts backoff values from peers without adequate bounds checking, allowing attackers to specify values approaching the maximum representable Instant value in Rust.

During the heartbeat routine, when the implementation attempts to calculate backoff expiration by adding a slack duration to the stored backoff time, the arithmetic operation overflows. Rust's default behavior in release mode for checked arithmetic causes a panic, immediately terminating the affected node.

Root Cause

The root cause is insufficient input validation on the backoff duration value received in PRUNE control messages. The implementation stores near-maximum backoff values as Instant types without verifying that subsequent arithmetic operations (adding slack duration) will not cause overflow. The use of unchecked Instant + Duration arithmetic in the heartbeat handler creates the exploitable condition.

Attack Vector

This vulnerability is reachable over the network from any Gossipsub peer through normal TCP + Noise + mplex/yamux connectivity. The attack requires no authentication beyond establishing a peer connection and becoming a protocol participant. An attacker can:

  1. Join the Gossipsub network as a peer
  2. Establish a standard libp2p connection using TCP with Noise encryption
  3. Send a crafted PRUNE control message containing a near-maximum backoff value
  4. Wait for the target node's heartbeat routine to execute
  5. Trigger the overflow panic, crashing the target node

The vulnerability mechanism involves crafting a PRUNE message with a backoff value near the maximum representable instant. When the heartbeat routine executes and attempts to add a slack duration to this backoff time, the arithmetic overflow triggers a Rust panic, causing the node to crash. See the GitHub Security Advisory for detailed technical information.

Detection Methods for CVE-2026-34219

Indicators of Compromise

  • Unexpected node crashes or restarts with panic messages containing "overflow when adding duration to instant"
  • PRUNE control messages with abnormally large backoff duration values in Gossipsub traffic
  • Repeated connection attempts from suspicious peers followed by node crashes
  • Log entries indicating panic in Gossipsub heartbeat handling routines

Detection Strategies

  • Monitor application logs for panic messages related to instant/duration overflow arithmetic
  • Implement network-level monitoring to detect anomalous PRUNE message patterns with extreme backoff values
  • Deploy crash reporting and automatic restart monitoring to identify exploitation attempts
  • Analyze Gossipsub protocol traffic for malformed or suspicious control messages

Monitoring Recommendations

  • Enable verbose logging for libp2p Gossipsub components to capture incoming control messages
  • Set up alerting for unexpected process terminations in peer-to-peer network nodes
  • Monitor peer connection patterns for behavior consistent with exploitation attempts
  • Implement health checks to detect and respond to repeated node crashes

How to Mitigate CVE-2026-34219

Immediate Actions Required

  • Upgrade to libp2p-rust version 0.49.4 or later immediately
  • Review and restart any affected libp2p-rust nodes after patching
  • Monitor nodes for crash events that may indicate active exploitation
  • Consider temporarily restricting peer connections to trusted nodes until patching is complete

Patch Information

The vulnerability has been patched in libp2p-rust version 0.49.4. The fix implements proper bounds checking on backoff duration values received in PRUNE control messages to prevent overflow conditions during heartbeat arithmetic operations.

For detailed patch information and release notes, refer to the GitHub Security Advisory.

Workarounds

  • Implement network-level filtering to detect and block PRUNE messages with extreme backoff values
  • Deploy monitoring and automatic restart mechanisms to minimize downtime from crashes
  • Limit peer connections to trusted nodes or implement additional peer validation
  • Consider running nodes behind load balancers with health check failover
bash
# Update libp2p-rust dependency in Cargo.toml
# Change libp2p version to 0.49.4 or later
cargo update -p libp2p
cargo build --release

# Verify the updated version
cargo tree -p libp2p | grep libp2p

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

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

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.