title: Excessive memory growth in net/http and golang.org/x/net/http2
description: An attacker can cause excessive memory growth in a Go server accepting HTTP/2 requests. HTTP/2 server connections contain a cache of HTTP header keys sent by the client. While the total number of entries in this cache is capped, an attacker sending very large keys can cause the server to allocate approximately 64 MiB per open connection.
problem types: CWE 400: Uncontrolled Resource Consumption
affected:
{
vendor: Go standard library
product: net/http
collectionURL: https://pkg.go.dev
packageName: net/http
versions:
version: 0, lessThan: 1.18.9, status: affected, versionType: semver
version: 1.19.0-0, lessThan: 1.19.4, status: affected, versionType: semver
programRoutines:
name: http2serverConn.canonicalHeader
name: ListenAndServe
name: ListenAndServeTLS
name: Serve
name: ServeTLS
name: Server.ListenAndServe
name: Server.ListenAndServeTLS
name: Server.Serve
name: Server.ServeTLS
name: http2Server.ServeConn
defaultStatus: unaffected
}
{
vendor: golang.org/x/net
product: golang.org/x/net/http2
collectionURL: https://pkg.go.dev
packageName: golang.org/x/net/http2
versions:
version: 0, lessThan: 0.4.0, status: affected, versionType: semver
programRoutines:
name: serverConn.canonicalHeader
name: Server.ServeConn
defaultStatus: unaffected
}
