Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/vulndb: potential Go vuln in github.com/libp2p/go-libp2p: GHSA-gcq9-qqwx-rgj3 #2024

Closed
GoVulnBot opened this issue Aug 24, 2023 · 1 comment
Assignees

Comments

@GoVulnBot
Copy link

In GitHub Security Advisory GHSA-gcq9-qqwx-rgj3, there is a vulnerability in the following Go packages or modules:

Unit Fixed Vulnerable Ranges
github.com/libp2p/go-libp2p 0.27.4 <= 0.27.3

Cross references:

See doc/triage.md for instructions on how to triage this report.

modules:
    - module: github.com/libp2p/go-libp2p
      versions:
        - introduced: TODO (earliest fixed "0.27.4", vuln range "<= 0.27.3")
      vulnerable_at: 0.30.0
      packages:
        - package: github.com/libp2p/go-libp2p
summary: libp2p nodes vulnerable to OOM attack
description: |-
    ### Summary In go-libp2p, by using signed peer records a malicious actor can
    store an arbitrary amount of data in a remote node’s memory. This memory does
    not get garbage collected and so the victim can run out of memory and crash.

    It is feasible to do this at scale. An attacker would have to transfer ~1/2 as
    much memory it wants to occupy (2x amplification factor).

    The attacker can perform this attack over time as the target node’s memory
    will not be garbage collected.

    This can occur because when a signed peer record is received, only the signature
    validity check is performed but the sender signature is not checked. Signed peer
    records from randomly generated peers can be sent by a malicious actor. A target
    node will accept the peer record as long as the signature is valid, and then
    stored in the peer store.

    There is cleanup logic in the peer store that cleans up data when a peer
    disconnects, but this cleanup is never triggered for the fake peer (from which
    signed peer records were accepted) because it was never “connected”.

    ### Impact If users of go-libp2p in production are not monitoring memory
    consumption over time, it could be a silent attack i.e. the attacker could bring
    down nodes over a period of time (how long depends on the node resources i.e. a
    go-libp2p node on a virtual server with 4 gb of memory takes about 90 sec to
    bring down; on a larger server, it might take a bit longer.)

    ### Patches Update your go-libp2p dependency to the latest release, v0.30.0 at
    the time of writing.

    If you'd like to stay on the 0.27.x release, we strongly recommend users to
    update to go-libp2p
    [0.27.7](https://github.com/libp2p/go-libp2p/releases/tag/v0.27.7). Though this
    OOM issue was fixed in 0.27.4, there were subsequent patch releases afterwards
    (important fixes for other issues unrelated to the OOM).

    ### Workarounds None
ghsas:
    - GHSA-gcq9-qqwx-rgj3
references:
    - advisory: https://github.com/libp2p/go-libp2p/security/advisories/GHSA-gcq9-qqwx-rgj3
    - fix: https://github.com/libp2p/go-libp2p/commit/45d3c6fff662ddd6938982e7e9309ad5fa2ad8dd
    - web: https://github.com/libp2p/go-libp2p/releases/tag/v0.27.4
    - advisory: https://github.com/advisories/GHSA-gcq9-qqwx-rgj3

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/527577 mentions this issue: data/reports: add GO-2023-2024.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants