Nimiq Libp2p Message Handling Vulnerability Leading to Denial-of-Service
Vulnerability
A vulnerability exists in the Nimiq libp2p implementation prior to version 1.3.0, where the message codec reads the entire stream into memory before validating the size. This flaw allows a remote peer to send a partial frame and keep the substream open, potentially leading to excessive memory allocation. The issue is exacerbated by the default setting of 1000 concurrent streams, which can significantly increase the stalled-slot budget. The vulnerability has been patched in version 1.3.0.
Impact
Exploitation of this vulnerability could cause a denial-of-service condition by allowing a remote peer to manipulate memory usage, leading to potential performance degradation or resource exhaustion.
Reproduction
The vulnerability can be reproduced by sending a partial frame over an inbound substream while keeping the substream open. This can be done by exploiting the message codec's behavior of reading the entire stream before size validation, combined with the ability to maintain multiple concurrent streams.
Remediation
Users can upgrade to Nimiq Libp2p version 1.3.0 or later, where this vulnerability has been fixed.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
