Skip to main content
Menu
Advisories

Micronaut JSON stream processing has no element size bound, ignores backpressure and copies quadratically

GHSA-5PXM-5867-GJC9Published Updated GitHub

Description

JsonChunkedProcessor, used for @Body Publisher<T> request bodies and for client jsonStream, buffers each JSON element without a size limit, ignores downstream demand (about 280 MB of heap from a 13 KB gzip body), and recopies the accumulated buffer on every chunk, giving quadratic CPU on the event loop. Its UTF-16 detection is also skipped after leading whitespace. An unauthenticated client (or a malicious upstream for the HTTP client) can exhaust memory or stall an event loop with a small request. The fix is to bound element size by the configured content limit, honour demand, and append chunks without recopying.

Affected and patched versions

JsonChunkedProcessor and JsonCounter were first released in 4.0.0. The 3.x line uses the older Jackson stream processor. The 3.10.19 fix bounds streamed JSON element sizes in micronaut-http-client; the 3.x package entry below covers that client variant.

PackageAffected versionsPatched version
io.micronaut:micronaut-http-client>= 3.0.0, < 3.10.193.10.19
io.micronaut:micronaut-http-netty>= 4.0.0, < 4.10.374.10.37
io.micronaut:micronaut-http-netty>= 5.0.0, < 5.2.235.2.23
io.micronaut:micronaut-http-server-netty>= 4.0.0, < 4.10.374.10.37
io.micronaut:micronaut-http-server-netty>= 5.0.0, < 5.2.235.2.23
io.micronaut:micronaut-http-client>= 4.0.0, < 4.10.374.10.37
io.micronaut:micronaut-http-client>= 5.0.0, < 5.2.235.2.23
io.micronaut:micronaut-json-core>= 4.0.0, < 4.10.374.10.37
io.micronaut:micronaut-json-core>= 5.0.0, < 5.2.235.2.23

The 3.x fix is in commit ed3d8a3750, first included in stable release 3.10.19. The last affected stable 3.10.x release is 3.10.18.

Findings

  • ANT-2026-Q09Q34P1
  • ANT-2026-QRQXP37P
  • ANT-2026-DW8LSNJ8
  • ANT-2026-Z14OZ7C9

Affected versions

References

GitHub · micronaut-projects/micronaut-core