HIGH 7.5

CVE-2026-49866: libp2p Gossipsub Event Loop DoS – Patch to 16.0.0

A vulnerability exists in libp2p's gossipsub implementation that allows attackers to send specially crafted network messages containing extremely large arrays of message identifiers. When the library processes these messages, it must iterate through tens of thousands of IDs synchronously, monopolizing the Node.js event loop and freezing the application. An attacker on the network can trigger this denial-of-service condition repeatedly without authentication.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-770
Affected products
0 configuration(s)
Published / Modified
2026-07-08 / 2026-07-10

NVD description (verbatim)

libp2p is a JavaScript Implementation of libp2p networking stack. Prior to 16.0.0, @libp2p/gossipsub defaultDecodeRpcLimits set maxIhaveMessageIDs and maxIwantMessageIDs to Infinity, allowing oversized IHAVE and IWANT control message arrays in message/decodeRpc.ts and gossipsub.ts to synchronously iterate roughly 180,000 message IDs per 4 MB frame and block the Node.js event loop. This issue is fixed in version 16.0.0.

4 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The @libp2p/gossipsub module before version 16.0.0 configures defaultDecodeRpcLimits with maxIhaveMessageIDs and maxIwantMessageIDs set to Infinity, removing practical constraints on control message array sizes. During RPC decoding in message/decodeRpc.ts and gossipsub.ts, the synchronous iteration over these unbounded arrays—potentially spanning ~180,000 message IDs per 4 MB frame—causes event loop blocking. This CWE-770 Resource Exhaustion condition leaves the Node.js process unresponsive to legitimate traffic and application logic.

Business impact

Peer-to-peer applications and mesh networks relying on libp2p gossipsub become unavailable when under attack. Services lose connectivity, fail to propagate messages, and cannot serve users. For platforms using gossipsub for consensus, coordination, or content distribution, a single attacker can cause widespread disruption without requiring privileged network access. Recovery requires manual intervention or timeout-based failover.

Affected systems

JavaScript/TypeScript applications using @libp2p/gossipsub versions prior to 16.0.0 are vulnerable. This includes peer-to-peer platforms, decentralized networks, distributed applications, and mesh networking overlays built on libp2p. The vulnerability affects any deployment where libp2p gossipsub is exposed to untrusted network peers.

Exploitability

Exploitability is straightforward for a network-adjacent attacker. No authentication, user interaction, or local access is required. An attacker merely constructs a gossipsub control message with oversized IHAVE or IWANT arrays and sends it to a vulnerable peer. The synchronous processing guarantees event loop starvation. The barrier to exploitation is low: knowledge of the gossipsub protocol and ability to reach the target peer on the network suffice.

Remediation

Upgrade @libp2p/gossipsub to version 16.0.0 or later. This release implements bounded limits on maxIhaveMessageIDs and maxIwantMessageIDs, ensuring that control message arrays are validated and truncated before synchronous iteration. Verify the upgrade across all application dependencies and peer nodes to maintain network consistency.

Patch guidance

Apply @libp2p/gossipsub version 16.0.0 as an urgent update. Review your package.json and lock files to confirm the installed version. If using a monorepo or pinned transitive dependency, ensure all consuming packages declare the correct version. Test the upgrade in a staging environment that simulates network load before rolling out to production. No configuration changes are required; the fix is automatic upon upgrade.

Detection guidance

Monitor Node.js process CPU and event loop latency metrics. Sudden spikes in synchronous CPU time or event loop lag correlated with incoming gossipsub traffic suggest potential attack. Log gossipsub RPC message sizes and array counts; oversized control messages should be flagged. Network intrusion detection can identify gossipsub frames exceeding typical size distributions. Consider ingesting libp2p debug logs to correlate message decode times with availability anomalies.

Why prioritize this

This vulnerability merits immediate action because it enables trivial network-based denial of service against a foundational mesh networking library. The low attack complexity, lack of authentication requirements, and high availability impact justify rapid remediation. Any organization operating public or semi-public peer-to-peer infrastructure should treat this as critical.

Risk score, explained

CVSS 3.1 score of 7.5 (HIGH) reflects an unauthenticated network attack with low complexity that causes total availability loss to affected services. Confidentiality and integrity remain unaffected—the attacker cannot steal data or corrupt state, only starve the event loop. The score aligns with the denial-of-service nature and the broad network-reachable attack surface.

Frequently asked questions

Can this vulnerability be exploited from outside the peer-to-peer network?

Yes. Any attacker who can send a network packet to a vulnerable gossipsub peer—either as a direct peer connection or via relay—can exploit this. No special network position or compromise of other systems is required.

Does upgrading to 16.0.0 require changes to application code?

No. The patch is transparent. Once you upgrade the @libp2p/gossipsub package, the bounded limits are enforced automatically. Existing application logic remains unchanged.

What happens to oversized control messages after the patch?

Version 16.0.0 validates incoming control messages against the new finite limits and either truncates or rejects arrays that exceed bounds, preventing the synchronous iteration that caused event loop blocking.

Are there workarounds if I cannot patch immediately?

Mitigation is difficult without patching. Network-level filtering of oversized gossipsub frames is cumbersome and may interfere with legitimate large messages. Isolating vulnerable nodes or reducing peer count can reduce attack surface, but the fundamental issue requires the upgrade.

This analysis is based on the CVE record and vendor advisory as of the publication date. Verify all version numbers, platform support, and remediation steps directly with the libp2p project and your organization's dependency management. This vulnerability requires a code update; no configuration or network-only mitigations provide complete protection. Test patches in non-production environments before deployment. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).