Micronaut caches keyed by request-controlled values grow without bound (incomplete fix of GHSA-2hcp-gjrf-7fhc)
Description
Several caches are populated from request input without a meaningful bound. The message body reader cache in AbstractMessageBodyHandlerRegistry is keyed by the request Content-Type, the CharSequence-to-SameSite converter keeps every distinct input string, the HTML error page cache bounds entries but not their size (so the GHSA-2hcp-gjrf-7fhc fix is incomplete), and long Accept-Language tags populate JDK locale caches through Micronaut's locale resolution (variant of GHSA-8hjv-92q9-g4xj). An unauthenticated client can grow the heap with each distinct header value until the server runs out of memory. The fix is to key caches only on normalised, known values (or not cache request-derived keys), bound caches by weight, and reject over-long locale tags before resolution.
Affected and patched versions
The body-handler registry cache (F25) starts in 4.0.0, the SameSite converter cache (F47) in 4.4.0, and the HTML error-page cache (KXHIU602) in 4.7.0. Locale-derived caches reached through Accept-Language (86FR77RQ, micronaut-core) also affect 3.x.
| Package | Affected versions | Patched version |
|---|---|---|
io.micronaut:micronaut-http | >= 4.0.0, < 4.10.37 | 4.10.37 |
io.micronaut:micronaut-http | >= 5.0.0, < 5.2.23 | 5.2.23 |
io.micronaut:micronaut-http-server | >= 4.7.0, < 4.10.37 | 4.10.37 |
io.micronaut:micronaut-http-server | >= 5.0.0, < 5.2.23 | 5.2.23 |
io.micronaut:micronaut-core | < 3.10.19 | 3.10.19 |
io.micronaut:micronaut-core | >= 4.0.0, < 4.10.37 | 4.10.37 |
io.micronaut:micronaut-core | >= 5.0.0, < 5.2.23 | 5.2.23 |
The 3.x fix is in commit e5123c049e, first included in stable release 3.10.19. The last affected stable 3.10.x release is 3.10.18.
Findings
- F25 (= ANT-2026-JV5QSOE9)
- F47 (= ANT-2026-002EMMO8)
- ANT-2026-KXHIU602
- ANT-2026-86FR77RQ
Affected versions
- io.micronaut:micronaut-httpFrom 4.0.0 · fixed in 4.10.37
- io.micronaut:micronaut-httpFrom 5.0.0 · fixed in 5.2.23
- io.micronaut:micronaut-http-serverFrom 4.7.0 · fixed in 4.10.37
- io.micronaut:micronaut-http-serverFrom 5.0.0 · fixed in 5.2.23
- io.micronaut:micronaut-corefixed in 3.10.19
- io.micronaut:micronaut-coreFrom 4.0.0 · fixed in 4.10.37
- io.micronaut:micronaut-coreFrom 5.0.0 · fixed in 5.2.23