GHSA-jvgw-gccv-q5p8

Suggest an improvement
Source
https://github.com/advisories/GHSA-jvgw-gccv-q5p8
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/12/GHSA-jvgw-gccv-q5p8/GHSA-jvgw-gccv-q5p8.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-jvgw-gccv-q5p8
Aliases
Published
2022-12-07T20:28:46Z
Modified
2023-11-08T04:08:18.938960Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
libp2p DoS vulnerability from lack of resource management
Details

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 security@libp2p.io.

Database specific
{
    "nvd_published_at": "2022-12-07T21:15:00Z",
    "cwe_ids": [
        "CWE-400",
        "CWE-770"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2022-12-07T20:28:46Z"
}
References

Affected packages

crates.io / libp2p

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.45.1

Database specific

{
    "last_known_affected_version_range": "<= 0.45.0"
}