CVE-2026-49866: libp2p: CPU DoS via oversized IHAVE and IWANT control message arrays
gossipsub processes IHAVE and IWANT control messages by iterating every received message ID synchronously before doing anything with the results. There is no cap on how many IDs a single frame may contain. The default LP frame limit is 4MB, which fits roughly 180,000 message IDs. Iterating that many IDs blocks the Node.js event loop for around 200ms per call.
The two variants have different severity. For IHAVE there is a per-peer per-heartbeat counter that limits each peer to one full iteration per heartbeat, so causing a total stall requires around 10 Sybil peers. For IWANT there is no equivalent counter at all, so a single peer continuously streaming 4MB frames can hold the event loop above 80% utilisation indefinitely.
References
- github.com/advisories/GHSA-cwc9-cp4j-mcvv
- github.com/libp2p/js-libp2p/commit/773dd80ded24dbd6b19e675c89fd2f3b45f2d899
- github.com/libp2p/js-libp2p/pull/3520
- github.com/libp2p/js-libp2p/releases/tag/gossipsub-v16.0.0
- github.com/libp2p/js-libp2p/security/advisories/GHSA-cwc9-cp4j-mcvv
- nvd.nist.gov/vuln/detail/CVE-2026-49866
Code Behaviors & Features
Detect and mitigate CVE-2026-49866 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →