Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1qdmd3LWdjY3YtcTVwOM4AAwMw

libp2p DoS vulnerability from lack of resource management

Impact

An attacker node can cause a victim node to allocate a large number of small memory chunks, which can ultimately lead to the victim’s process running out of memory and thus getting killed by its operating system. When executed continuously, this can lead to a denial of service attack, especially relevant on a larger scale when run against more than one node of a libp2p based network.

Details

In the original version of the attack, the malicious node would continuously open new streams on a single connection using a stream multiplexer that doesn’t provide sufficient back pressure (mplex or yamux). While allocations per stream might be considered small, they multiply with the number of streams and connections. It is easy to defend against this one attack, e.g. by setting a strict per connection stream limit and connection limit. But there are other variations of this attack, e.g. causing memory allocations by sending partial payloads on various protocol levels, forcing the victim to buffer the partial payload for a period of time or by tricking the victim into pre-allocating buffers for messages which are never sent by the attacker.

Patches

Users are advised to upgrade to libp2p v0.45.1 or above.

References

Please see our DoS Mitigation page for more information on how to incorporate mitigation strategies, monitor your application, and respond to attacks: https://docs.libp2p.io/reference/dos-mitigation/.

Please see the related disclosure for go-libp2p: https://github.com/libp2p/go-libp2p/security/advisories/GHSA-j7qp-mfxf-8xjw and js-libp2p: https://github.com/libp2p/js-libp2p/security/advisories/GHSA-f44q-634c-jvwv

For more information

If you have any questions or comments about this advisory, please email us at [email protected].

Permalink: https://github.com/advisories/GHSA-jvgw-gccv-q5p8
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1qdmd3LWdjY3YtcTVwOM4AAwMw
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: over 1 year ago
Updated: 10 months ago


CVSS Score: 7.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Identifiers: GHSA-jvgw-gccv-q5p8, CVE-2022-23486
References: Repository: https://github.com/libp2p/go-libp2p
Blast Radius: 24.1

Affected Packages

cargo:libp2p
Dependent packages: 123
Dependent repositories: 1,645
Downloads: 5,086,948 total
Affected Version Ranges: <= 0.45.0
Fixed in: 0.45.1
All affected versions: 0.0.1, 0.1.0, 0.2.0, 0.2.1, 0.2.2, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.4.2, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.9.2, 0.10.0, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.13.2, 0.15.0, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.18.0, 0.18.1, 0.19.0, 0.19.1, 0.20.0, 0.20.1, 0.21.0, 0.21.1, 0.22.0, 0.23.0, 0.24.0, 0.25.0, 0.26.0, 0.27.0, 0.28.0, 0.28.1, 0.29.0, 0.29.1, 0.30.0, 0.30.1, 0.31.0, 0.31.1, 0.31.2, 0.32.0, 0.32.1, 0.32.2, 0.33.0, 0.34.0, 0.35.0, 0.35.1, 0.36.0, 0.37.0, 0.37.1, 0.38.0, 0.39.0, 0.39.1, 0.40.0, 0.41.0, 0.41.1, 0.41.2, 0.42.0, 0.42.1, 0.42.2, 0.43.0, 0.44.0, 0.45.0
All unaffected versions: 0.45.1, 0.46.0, 0.46.1, 0.47.0, 0.48.0, 0.49.0, 0.50.0, 0.50.1, 0.51.0, 0.51.1, 0.51.2, 0.51.3, 0.51.4, 0.52.0, 0.52.1, 0.52.2, 0.52.3, 0.52.4, 0.53.0, 0.53.1, 0.53.2