GO-2022-1148

Source
https://pkg.go.dev/vuln/GO-2022-1148
Import Source
https://vuln.go.dev/ID/GO-2022-1148.json
JSON Data
https://api.test.osv.dev/v1/vulns/GO-2022-1148
Aliases
Published
2022-12-14T02:21:28Z
Modified
2024-05-20T16:03:47Z
Summary
Resource exhaustion in github.com/libp2p/go-libp2p
Details

go-libp2p is vulnerable to targeted resource exhaustion attacks.

These attacks target libp2p's connection, stream, peer, and memory management. An attacker can cause the allocation of large amounts of memory ultimately leading to the process getting killed by the host's operating system.

While a connection manager tasked with keeping the number of connections within manageable limits has been part of go-libp2p, this component was designed to handle the regular churn of peers, not a targeted resource exhaustion attack.

It's recommend to update to v0.21.0 onwards to get some useful functionality that will help in production environments like better metrics around resource usage, Grafana dashboards around resource usage, allow list support, and default autoscaling limits.

Database specific
{
    "review_status": "REVIEWED",
    "url": "https://pkg.go.dev/vuln/GO-2022-1148"
}
References

Affected packages

Go / github.com/libp2p/go-libp2p

Package

Name
github.com/libp2p/go-libp2p
View open source insights on deps.dev
Purl
pkg:golang/github.com/libp2p/go-libp2p

Affected ranges

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

Ecosystem specific

{
    "imports": [
        {
            "path": "github.com/libp2p/go-libp2p",
            "symbols": [
                "DefaultStaticRelays",
                "Muxer",
                "New",
                "NewWithoutDefaults",
                "Security",
                "Transport"
            ]
        },
        {
            "path": "github.com/libp2p/go-libp2p/config",
            "symbols": [
                "Config.NewNode",
                "MuxerConstructor",
                "SecurityConstructor",
                "TransportConstructor",
                "makeArgumentConstructors",
                "makeConstructor",
                "makeMuxer",
                "makeTransports"
            ]
        },
        {
            "path": "github.com/libp2p/go-libp2p/p2p/host/autonat",
            "symbols": [
                "New",
                "autoNATService.handleStream",
                "client.DialBack"
            ]
        },
        {
            "path": "github.com/libp2p/go-libp2p/p2p/host/basic",
            "symbols": [
                "BasicHost.newStreamHandler",
                "NewHost"
            ]
        },
        {
            "path": "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/relay",
            "symbols": [
                "NewRelay"
            ]
        },
        {
            "path": "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client",
            "symbols": [
                "Client.Dial",
                "Client.connectV1",
                "Client.connectV2"
            ]
        },
        {
            "path": "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay",
            "symbols": [
                "New",
                "Relay.Close",
                "Relay.handleConnect",
                "Relay.handleStream"
            ]
        },
        {
            "path": "github.com/libp2p/go-libp2p/p2p/protocol/holepunch",
            "symbols": [
                "Service.DirectConnect",
                "Service.handleNewStream",
                "Service.incomingHolePunch",
                "Service.initiateHolePunch",
                "netNotifiee.Connected"
            ]
        }
    ]
}