/

CVE-2026-45783

Severity:

HIGH RISK

(7.5)

Input Validation Flaw (CWE-20) in libp2p Kademlia DHT

CVE-2026-45783

Deferred

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20, CWE-400

Impact:

Denial of Service via Resource Exhaustion

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A validation bypass in the JavaScript libp2p Kademlia DHT allows remote peers to store unbounded data on nodes running in server mode by abusing PUT_VALUE messages.

Because keys are not properly validated, an unauthenticated attacker can fill the node's datastore until disk space is exhausted, causing denial of service.

Affected context

This vulnerability occurs in applications using the JavaScript @libp2p/kad-dht implementation configured in server mode, where nodes accept and store values from remote peers.

It is relevant when the DHT node persists received records to a local datastore on disk and relies on key-based validation to control what is stored.

Environments with limited disk capacity, high exposure to untrusted peers, or minimal network-level protections are particularly susceptible to this issue.

Exploit preconditions

  • Attack surface: Public-facing @libp2p/kad-dht nodes operating in server mode and reachable over the libp2p network.
  • Required access: None beyond basic network reachability; no authentication, credentials, or prior trust relationship are needed.
  • Trigger point: Continuous sending of crafted PUT_VALUE messages with keys that bypass the existing content validation logic, causing each payload to be stored.
  • Why exploitation is possible: The implementation does not sufficiently validate or constrain incoming keys and stored data volume, allowing unbounded growth of the datastore and disk usage.

Why this happens

The core defect is improper input validation (CWE-20) combined with uncontrolled resource consumption (CWE-400).

The Kademlia DHT implementation treats certain attacker-controlled keys as valid without enforcing strict format, namespace, or policy checks.

As a result, the node accepts and persists records associated with these keys without effective limits on quantity or size, allowing an attacker to drive unbounded disk writes.

Abstractly, this is an input validation gap on protocol-level parameters (DHT keys) that should be normalized, filtered, and constrained before they influence persistent storage.

Potential impact

  • The node may become unavailable due to complete disk exhaustion.
  • Other services sharing the same host can experience performance degradation or failure.
  • System stability and observability may be affected as logs and critical processes fail when disk space is exhausted.
  • Operators may incur operational overhead for manual cleanup, node reprovisioning, or data restoration.

General mitigation guidance

Mitigation generally focuses on hardening input validation and constraining resource usage by untrusted peers:

  • Enforce strict validation rules on DHT keys and associated values, accepting only well-formed, expected key namespaces and formats.
  • Introduce quotas or rate limits on the number and size of stored records per peer, per time window, or per key prefix.
  • Apply storage limits and eviction policies (e.g., LRU, TTL-based expiry) to prevent unbounded datastore growth.
  • Separate critical system partitions from application data and use disk-level quotas or container limits to isolate impact.
  • Prefer secure-by-default configurations where server-mode behavior is opt-in and clearly documented with resource constraints.

How teams detect issues like this

Detection can rely on both code-centric and operational techniques:

  • Use static analysis or code review to identify storage operations that depend on attacker-controlled keys or inputs without rigorous validation or bounds checking.
  • Review protocol handlers (e.g., PUT_VALUE message handling) for missing constraints on key structure, allowed namespaces, or maximum data volume.
  • Deploy monitoring for unusual spikes in PUT_VALUE traffic, datastore growth rates, and disk utilization on DHT nodes.
  • Configure alerting on disk space thresholds and abnormal write patterns, correlating them with libp2p node logs and peer activity.
  • Integrate automated security scanning tools or CI rules that flag resource allocation based solely on untrusted network input.

Sources

SourceLink
github.comgithub.com/libp2p/js-libp2p/security/advisories/GHSA-32mq-hpph-xfvr

Frequently asked

questions

Yes. Any remote peer that can reach a vulnerable @libp2p/kad-dht node in server mode can attempt to exploit the issue without authentication or a pre-existing relationship.

The attacker only needs network-level access to the DHT node. No credentials, special privileges, or protocol deviations beyond sending crafted PUT_VALUE messages are required.

The safest pattern is to enforce strict validation on DHT keys and values, combined with hard limits on how much data can be stored per peer or per keyspace, and robust eviction policies to ensure storage remains bounded.

Future prevention should include designing protocol handlers with strict input validation, adding defensive resource accounting around all persistence and memory allocations influenced by untrusted input, and regularly reviewing P2P-facing components for potential resource exhaustion paths under adversarial traffic.

Find out what's already
exploitable in your codebase.