Http4s: Ember HTTP/2 buffers a frame's declared payload before checking SETTINGS_MAX_FRAME_SIZE
http4s
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| org.http4s:http4s-ember-core_2.13 Maven |
|
|
| org.http4s:http4s-ember-core_2.12 Maven |
|
http4s
| Product | Affected | Fixed in |
|---|---|---|
| org.http4s:http4s-ember-core_2.13 Maven |
|
|
| org.http4s:http4s-ember-core_2.12 Maven |
|
0.23.37| org.http4s:http4s-ember-core_3 Maven |
|
|
Http4s is a Scala interface for HTTP services. Prior to 0.23.37 and 1.0.0-M48, Ember’s HTTP/2 read loop parses a frame’s 24-bit declared length but waits to buffer the entire payload before comparing it with SETTINGS_MAX_FRAME_SIZE. An unauthenticated peer can declare a payload near 16 MiB on a connection where Ember advertised 16 KiB and either complete or slowly stream it, causing up to 1024-fold memory amplification per connection before processFrame can reject the frame. The shared H2Connection.readLoop affects withHttp2 servers and clients, while HTTP/2-disabled configurations are unaffected, and the patch rejects oversized frames before buffering their payloads. This issue is fixed in versions 0.23.37 and 1.0.0-M48.
From the CVE record · GitHub_M
Ember’s HTTP/2 read loop buffers a frame’s declared payload before checking whether it exceeds the advertised maximum frame size. An unauthenticated network peer can send or slowly stream an oversized frame, causing substantial memory use per connection; HTTP/2-disabled configurations are unaffected.
Teams running HTTP/2 with Maven org.http4s:http4s-ember-core_2.12, _2.13, or _3 before 0.23.37, or _2.13 or _3 milestones from 1.0.0-M1 through 1.0.0-M47, should check their deployments.