<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Libp2p — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/libp2p/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 19 May 2026 20:09:11 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/libp2p/feed.xml" rel="self" type="application/rss+xml"/><item><title>@libp2p/kad-dht Unvalidated PUT_VALUE Records Allow Unbounded Disk Exhaustion</title><link>https://feed.craftedsignal.io/briefs/2026-05-kad-dht-dos/</link><pubDate>Tue, 19 May 2026 20:09:11 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-kad-dht-dos/</guid><description>An unauthenticated remote peer can exhaust the disk storage of any `@libp2p/kad-dht` node running in server mode by sending an unbounded stream of `PUT_VALUE` messages with crafted keys to bypass validation and cause disk exhaustion.</description><content:encoded><![CDATA[<p>The <code>@libp2p/kad-dht</code> library is vulnerable to a denial-of-service attack where an unauthenticated remote peer can exhaust the disk storage of a node running in server mode. This is achieved by sending an unbounded stream of <code>PUT_VALUE</code> messages with specially crafted keys that bypass content validation. The vulnerability stems from two key defects in the code. First, the <code>verifyRecord</code> function silently returns success for keys with fewer than three slash-delimited parts, leading to unconditional writes to the datastore. Second, the RPC message loop lacks proper rate limiting or message count limits, allowing an attacker to stream an unlimited number of messages indefinitely by resetting the inactivity timeout with each message. This can lead to the victim node&rsquo;s datastore filling up until the host disk is exhausted, making the node unavailable. The issue affects <code>@libp2p/kad-dht</code> versions prior to the fix.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker establishes a TLS handshake with the target <code>@libp2p/kad-dht</code> node without authentication.</li>
<li>Attacker opens a new stream to send <code>PUT_VALUE</code> messages. The target node can accept up to 32 concurrent inbound streams.</li>
<li>Attacker crafts a <code>PUT_VALUE</code> message with a key that has fewer than three slash-delimited parts (e.g., <code>\x01\x02\x03</code>).</li>
<li>The <code>verifyRecord</code> function in <code>packages/kad-dht/src/record/validators.ts</code> silently returns without validation because the key does not conform to the expected format.</li>
<li>The crafted record is written to the target node&rsquo;s datastore. Each message can contain up to 4MB of data due to the <code>DEFAULT_MAX_DATA_LENGTH</code>.</li>
<li>The target node resets the inactivity timeout (<code>this.incomingMessageTimeout</code>) after processing each message in the RPC loop in <code>packages/kad-dht/src/rpc/index.ts</code>.</li>
<li>The attacker repeats steps 3-6 indefinitely, sending a continuous stream of invalid <code>PUT_VALUE</code> messages within the 10-second timeout window.</li>
<li>The target node&rsquo;s datastore fills up with unvalidated data, exhausting the disk space and causing a denial-of-service.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability results in a denial-of-service condition. An attacker can remotely exhaust the disk space of any <code>@libp2p/kad-dht</code> node running in server mode, rendering it unavailable. Since the attack is unauthenticated and can be performed over multiple concurrent streams, it has the potential to impact a large number of nodes. The number of victims and the sectors targeted would depend on the deployment size of <code>@libp2p/kad-dht</code> nodes. If successful, legitimate services relying on the DHT network may be disrupted.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply the patch or upgrade to a version of <code>@libp2p/kad-dht</code> that includes the fix for the unbounded <code>PUT_VALUE</code> vulnerability as detailed in <a href="https://github.com/advisories/GHSA-32mq-hpph-xfvr">GHSA-32mq-hpph-xfvr</a>.</li>
<li>Implement rate limiting or message count limits on incoming streams to prevent unbounded message loops in <code>packages/kad-dht/src/rpc/index.ts</code>.</li>
<li>Deploy the Sigma rule <code>Detect Libp2p Kad-DHT Unvalidated PUT_VALUE Attack</code> to detect unusual amounts of PUT_VALUE messages with crafted keys.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">threat</category><category>libp2p</category><category>kad-dht</category><category>denial-of-service</category><category>disk-exhaustion</category></item></channel></rss>