HTTP/2 CONTINUATION flood in net/http
Go standard library net/http · golang.org/x/net/http2
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| net/http Go |
|
|
| golang.org/x/net/http2 Go |
|
|
Go standard library net/http · golang.org/x/net/http2
| Product | Affected | Fixed in |
|---|---|---|
| net/http Go |
|
|
| golang.org/x/net/http2 Go |
|
|
| golang.org/x/net Go |
|
|
| stdlib Go |
|
|
An attacker may cause an HTTP/2 endpoint to read arbitrary amounts of header data by sending an excessive number of CONTINUATION frames. Maintaining HPACK state requires parsing and processing all HEADERS and CONTINUATION frames on a connection. When a request's headers exceed MaxHeaderBytes, no memory is allocated to store the excess headers, but they are still parsed. This permits an attacker to cause an HTTP/2 endpoint to read arbitrary amounts of header data, all associated with a request which is going to be rejected. These headers can include Huffman-encoded data which is significantly more expensive for the receiver to decode than for an attacker to send. The fix sets a limit on the amount of excess header frames we will process before closing a connection.
From the CVE record · Go
Go's net/http and golang.org/x/net/http2 can process arbitrary amounts of header data from excessive HTTP/2 CONTINUATION frames, even when the request will be rejected for exceeding MaxHeaderBytes. A network attacker can use this to consume processing resources; Huffman-encoded headers can make decoding especially costly. The input does not specify an authentication requirement or user interaction.
Engineers running Go net/http or the Go standard library before 1.21.9 or from 1.22.0 up to but not including 1.22.2, or using golang.org/x/net or golang.org/x/net/http2 before 0.23.0, should check their deployments.