CVE-2026-44241: Micronaut context Micronaut Has Unbounded `formattersCache` Vulnerability

HIGH
Advisory Identifier: GHSA-8hjv-92q9-g4xj
CVSS 7.5
CWE-400
Published
Advisory Summary

CVE-2026-44241 is a HIGH (CVSS 7.5) micronaut has unbounded `formatterscache` vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Micronaut context libraries in the Maven ecosystem. The issue involves micronaut has unbounded `formatterscache` in `timeconverterregistrar` that allows memory exhaustion via `accept-language` header. Remediation is available by upgrading affected packages to version 4.10.22, 3.10.6, 3.8.14.

CVE-2026-44241 at a Glance

CVE Identifier CVE-2026-44241
GHSA Identifier GHSA-8hjv-92q9-g4xj
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Micronaut context
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-44241

To remediate this vulnerability, upgrade all affected Micronaut context dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

io.micronaut:micronaut-context fixed: 4.10.22
<dependency>
    <groupId>io.micronaut</groupId>
    <artifactId>micronaut-context</artifactId>
    <version>4.10.22</version>
</dependency>
io.micronaut:micronaut-context fixed: 3.10.6
<dependency>
    <groupId>io.micronaut</groupId>
    <artifactId>micronaut-context</artifactId>
    <version>3.10.6</version>
</dependency>
io.micronaut:micronaut-context fixed: 3.8.14
<dependency>
    <groupId>io.micronaut</groupId>
    <artifactId>micronaut-context</artifactId>
    <version>3.8.14</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=io.micronaut

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2026-44241, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.micronaut

Analyze the terminal output to locate any version of Micronaut context in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.10.22), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.micronaut command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Micronaut context, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary `TimeConverterRegistrar` caches `DateTimeFormatter` instances in an unbounded `ConcurrentHashMap<String, DateTimeFormatter>` whose key is derived from the `@Format` annotation pattern concatenated with the locale from the HTTP `Accept-Language` header. Because `Locale.forLanguageTag()` accepts arbitrary BCP 47 private-use extensions (`en-x-a001`, `en-x-a002`, …), an unauthenticated attacker can generate an unlimited number of unique cache keys by sending requests with novel locale tags, growing the cache until heap memory is exhausted and the JVM crashes. This is structurally identical to the recently patched GHSA-2hcp-gjrf-7fhc (`DefaultHtmlErrorResponseBodyProvider`), but `TimeConverterRegistrar.formattersCache` was not covered by that fix. ## Details The vulnerable cache is declared in `context/src/main/java/io/micronaut/runtime/converters/time/TimeConverterRegistrar.java` at line 123: ```java // TimeConverterRegistrar.java:123 private final Map<String, DateTimeFormatter> formattersCache = new ConcurrentHashMap<>(); ``` The `getFormatter` method at line 434 inserts into this map with no eviction or size limit: ```java // TimeConverterRegistrar.java:434-443 private DateTimeFormatter getFormatter(String pattern, ConversionContext context) { var key = pattern + context.getLocale(); // locale from Accept-Language header var cachedFormatter = formattersCache.get(key); if (cachedFormatter != null) { return cachedFormatter; } var formatter = DateTimeFormatter.ofPattern(pattern, context.getLocale()); formattersCache.put(key, formatter); // NO SIZE CHECK — unbounded growth return formatter; } ``` The attacker-controlled locale flows into the cache key through this call chain: 1. **HTTP header parsed** — `HttpHeaders.findAcceptLanguage()` at `http/src/main/java/io/micronaut/http/HttpHeaders.java:766-771` calls `Locale.forLanguageTag(part)` directly on the raw `Accept-Language` value: ```java // HttpHeaders.java:766-771 default Optional<Locale> findAcceptLanguage() { return findFirst(HttpHeaders.ACCEPT_LANGUAGE) .map(text -> { String part = HttpHeadersUtil.splitAcceptHeader(text); return part == null ? Locale.getDefault() : Locale.forLanguageTag(part); }); } ``` 2. **Locale planted in ConversionContext** — `AbstractRouteMatch.newContext()` at `router/src/main/java/io/micronaut/web/router/AbstractRouteMatch.java:373-378` passes the request locale into the conversion context for every route argument binding: ```java // AbstractRouteMatch.java:373-378 private <E> ArgumentConversionContext<E> newContext(Argument<E> argument, HttpRequest<?> request) { return ConversionContext.of( argument, request.getLocale().orElse(null), // ← attacker-controlled via Accept-Language request.getCharacterEncoding() ); } ``` 3. **Unbounded cache insert** — When any temporal argument annotated with `@Format` is bound, `TimeConverterRegistrar.getFormatter(pattern, context)` is called and inserts a new `DateTimeFormatter` for each unique `pattern + locale` key. This path is triggered for any route endpoint with a `@Format`-annotated temporal parameter. This is an officially documented and commonly used Micronaut pattern, demonstrated in the framework's own test suite: ```java // test-suite/.../BindingController.java:105 (official Micronaut example) @Get("/dateFormat") public String dateFormat(@Format("dd/MM/yyyy hh:mm:ss a z") @Header ZonedDateTime date) { return date.toString(); } ``` `TimeConverterRegistrar` is an `@Internal` core bean registered unconditionally in every Micronaut application — it is not optional or user-configured. By contrast, the `DefaultHtmlErrorResponseBodyProvider` cache patched in GHSA-2hcp-gjrf-7fhc now uses a `ConcurrentLinkedHashMap` bounded at 100 entries; `TimeConverterRegistrar.formattersCache` remains an unbounded plain `ConcurrentHashMap`. ## PoC Against any Micronaut application exposing an endpoint with a `@Format`-annotated temporal parameter: ```bash # Flood the formattersCache with unique locale-derived keys for i in $(seq 1 200000); do curl -s -o /dev/null \ -H "Accept-Language: en-x-$(printf '%06d' $i)" \ -H "date: 01/01/2024 12:00:00 AM UTC" \ "http://localhost:8080/dateFormat" & # Throttle to avoid socket exhaustion [ $((i % 500)) -eq 0 ] && wait done wait # Server will throw OutOfMemoryError after enough unique locale entries accumulate ``` Each request with a novel `en-x-XXXXXX` private-use tag inserts a new `DateTimeFormatter` entry into the unbounded map. Each `DateTimeFormatter` (with locale metadata) occupies roughly 2–10 KB on the heap. At 100,000 unique entries, the map alone can consume ~500 MB; at 500,000 entries the JVM typically crashes with `OutOfMemoryError: Java heap space`. ## Impact - An unauthenticated attacker can crash any Micronaut server that exposes at least one endpoint with a `@Format`-annotated temporal type parameter — a documented, first-class framework feature. - Memory grows linearly with the number of unique `Accept-Language` values sent. The BCP 47 private-use namespace (`en-x-ANYTHING`) provides millions of distinct valid locale strings. - No credentials, special permissions, or exploitation of application logic are required — only the ability to send HTTP requests with custom headers. - `TimeConverterRegistrar` is active in all Micronaut HTTP server applications by default; no special configuration is needed to be vulnerable. ## Recommended Fix Apply the same fix pattern used for GHSA-2hcp-gjrf-7fhc: replace the unbounded `ConcurrentHashMap` with a bounded `ConcurrentLinkedHashMap`: ```java // In TimeConverterRegistrar.java — replace line 123 import io.micronaut.core.util.clhm.ConcurrentLinkedHashMap; private static final int MAX_FORMATTERS_CACHE_SIZE = 100; private final Map<String, DateTimeFormatter> formattersCache = new ConcurrentLinkedHashMap.Builder<String, DateTimeFormatter>() .maximumWeightedCapacity(MAX_FORMATTERS_CACHE_SIZE) .build(); ``` Alternatively, since `@Format` pattern values come from static annotations (a bounded, compile-time set), the locale should be excluded from the cache key and applied at use-time instead: ```java // In getFormatter() — cache only by pattern, apply locale at use-time private DateTimeFormatter getFormatter(String pattern, ConversionContext context) { DateTimeFormatter base = formattersCache.computeIfAbsent( pattern, p -> DateTimeFormatter.ofPattern(p) ); Locale locale = context.getLocale(); return locale != null ? base.withLocale(locale) : base; } ``` This second approach bounds the cache by the number of distinct `@Format` patterns in the application, which is always small and finite, fully eliminating the attack surface.

CVE-2026-44241 Affected Micronaut context Versions

3 component(s)
Fixed Versions:
4.10.223.10.63.8.14
Product / Package Ecosystem Affected Versions Fixed Version
io.micronaut:micronaut-context
Maven
≥ 4.3.0
< 4.10.22
4.10.22
io.micronaut:micronaut-context
Maven
≥ 3.10.0
< 3.10.6
3.10.6
io.micronaut:micronaut-context
Maven
< 3.8.14
3.8.14

References

Frequently Asked Questions

What is CVE-2026-44241?
CVE-2026-44241 is a security vulnerability in Micronaut context involving Micronaut has unbounded `formattersCache` in `TimeConverterRegistrar` that Allows Memory Exhaustion via `Accept-Language` Header under CWE-400: Uncontrolled Resource Consumption.
Which Micronaut context versions are affected?
Affected versions include releases prior to 4.10.22, 3.10.6, 3.8.14 across affected packages: io.micronaut:micronaut-context.
What version fixes CVE-2026-44241?
Upgrading to 4.10.22, 3.10.6, 3.8.14 (or the latest patched release for your respective branch) resolves the vulnerability.
Is micronaut-context affected?
Yes, io.micronaut:micronaut-context is affected in releases prior to 4.10.22, 3.10.6, 3.8.14. Upgrade your dependency to 4.10.22, 3.10.6, 3.8.14 or later.
What is the CVSS score of CVE-2026-44241?
CVE-2026-44241 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-44241?
CVE-2026-44241 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Maven dependencies for CVE-2026-44241?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.micronaut'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8hjv-92q9-g4xj",
  "modified" : "2026-07-10T00:09:19Z",
  "published" : "2026-05-06T20:00:22Z",
  "aliases" : [ "CVE-2026-44241" ],
  "summary" : "Micronaut has unbounded `formattersCache` in `TimeConverterRegistrar` that Allows Memory Exhaustion via `Accept-Language` Header",
  "details" : "## Summary\n\n`TimeConverterRegistrar` caches `DateTimeFormatter` instances in an unbounded `ConcurrentHashMap<String, DateTimeFormatter>` whose key is derived from the `@Format` annotation pattern concatenated with the locale from the HTTP `Accept-Language` header. Because `Locale.forLanguageTag()` accepts arbitrary BCP 47 private-use extensions (`en-x-a001`, `en-x-a002`, …), an unauthenticated attacker can generate an unlimited number of unique cache keys by sending requests with novel locale tags, growing the cache until heap memory is exhausted and the JVM crashes. This is structurally identical to the recently patched GHSA-2hcp-gjrf-7fhc (`DefaultHtmlErrorResponseBodyProvider`), but `TimeConverterRegistrar.formattersCache` was not covered by that fix.\n\n## Details\n\nThe vulnerable cache is declared in `context/src/main/java/io/micronaut/runtime/converters/time/TimeConverterRegistrar.java` at line 123:\n\n```java\n// TimeConverterRegistrar.java:123\nprivate final Map<String, DateTimeFormatter> formattersCache = new ConcurrentHashMap<>();\n```\n\nThe `getFormatter` method at line 434 inserts into this map with no eviction or size limit:\n\n```java\n// TimeConverterRegistrar.java:434-443\nprivate DateTimeFormatter getFormatter(String pattern, ConversionContext context) {\n    var key = pattern + context.getLocale();        // locale from Accept-Language header\n    var cachedFormatter = formattersCache.get(key);\n    if (cachedFormatter != null) {\n        return cachedFormatter;\n    }\n    var formatter = DateTimeFormatter.ofPattern(pattern, context.getLocale());\n    formattersCache.put(key, formatter);            // NO SIZE CHECK — unbounded growth\n    return formatter;\n}\n```\n\nThe attacker-controlled locale flows into the cache key through this call chain:\n\n1. **HTTP header parsed** — `HttpHeaders.findAcceptLanguage()` at `http/src/main/java/io/micronaut/http/HttpHeaders.java:766-771` calls `Locale.forLanguageTag(part)` directly on the raw `Accept-Language` value:\n\n```java\n// HttpHeaders.java:766-771\ndefault Optional<Locale> findAcceptLanguage() {\n    return findFirst(HttpHeaders.ACCEPT_LANGUAGE)\n        .map(text -> {\n            String part = HttpHeadersUtil.splitAcceptHeader(text);\n            return part == null ? Locale.getDefault() : Locale.forLanguageTag(part);\n        });\n}\n```\n\n2. **Locale planted in ConversionContext** — `AbstractRouteMatch.newContext()` at `router/src/main/java/io/micronaut/web/router/AbstractRouteMatch.java:373-378` passes the request locale into the conversion context for every route argument binding:\n\n```java\n// AbstractRouteMatch.java:373-378\nprivate <E> ArgumentConversionContext<E> newContext(Argument<E> argument, HttpRequest<?> request) {\n    return ConversionContext.of(\n        argument,\n        request.getLocale().orElse(null),   // ← attacker-controlled via Accept-Language\n        request.getCharacterEncoding()\n    );\n}\n```\n\n3. **Unbounded cache insert** — When any temporal argument annotated with `@Format` is bound, `TimeConverterRegistrar.getFormatter(pattern, context)` is called and inserts a new `DateTimeFormatter` for each unique `pattern + locale` key.\n\nThis path is triggered for any route endpoint with a `@Format`-annotated temporal parameter. This is an officially documented and commonly used Micronaut pattern, demonstrated in the framework's own test suite:\n\n```java\n// test-suite/.../BindingController.java:105 (official Micronaut example)\n@Get(\"/dateFormat\")\npublic String dateFormat(@Format(\"dd/MM/yyyy hh:mm:ss a z\") @Header ZonedDateTime date) {\n    return date.toString();\n}\n```\n\n`TimeConverterRegistrar` is an `@Internal` core bean registered unconditionally in every Micronaut application — it is not optional or user-configured. By contrast, the `DefaultHtmlErrorResponseBodyProvider` cache patched in GHSA-2hcp-gjrf-7fhc now uses a `ConcurrentLinkedHashMap` bounded at 100 entries; `TimeConverterRegistrar.formattersCache` remains an unbounded plain `ConcurrentHashMap`.\n\n## PoC\n\nAgainst any Micronaut application exposing an endpoint with a `@Format`-annotated temporal parameter:\n\n```bash\n# Flood the formattersCache with unique locale-derived keys\nfor i in $(seq 1 200000); do\n  curl -s -o /dev/null \\\n    -H \"Accept-Language: en-x-$(printf '%06d' $i)\" \\\n    -H \"date: 01/01/2024 12:00:00 AM UTC\" \\\n    \"http://localhost:8080/dateFormat\" &\n  # Throttle to avoid socket exhaustion\n  [ $((i % 500)) -eq 0 ] && wait\ndone\nwait\n# Server will throw OutOfMemoryError after enough unique locale entries accumulate\n```\n\nEach request with a novel `en-x-XXXXXX` private-use tag inserts a new `DateTimeFormatter` entry into the unbounded map. Each `DateTimeFormatter` (with locale metadata) occupies roughly 2–10 KB on the heap. At 100,000 unique entries, the map alone can consume ~500 MB; at 500,000 entries the JVM typically crashes with `OutOfMemoryError: Java heap space`.\n\n## Impact\n\n- An unauthenticated attacker can crash any Micronaut server that exposes at least one endpoint with a `@Format`-annotated temporal type parameter — a documented, first-class framework feature.\n- Memory grows linearly with the number of unique `Accept-Language` values sent. The BCP 47 private-use namespace (`en-x-ANYTHING`) provides millions of distinct valid locale strings.\n- No credentials, special permissions, or exploitation of application logic are required — only the ability to send HTTP requests with custom headers.\n- `TimeConverterRegistrar` is active in all Micronaut HTTP server applications by default; no special configuration is needed to be vulnerable.\n\n## Recommended Fix\n\nApply the same fix pattern used for GHSA-2hcp-gjrf-7fhc: replace the unbounded `ConcurrentHashMap` with a bounded `ConcurrentLinkedHashMap`:\n\n```java\n// In TimeConverterRegistrar.java — replace line 123\nimport io.micronaut.core.util.clhm.ConcurrentLinkedHashMap;\n\nprivate static final int MAX_FORMATTERS_CACHE_SIZE = 100;\n\nprivate final Map<String, DateTimeFormatter> formattersCache =\n    new ConcurrentLinkedHashMap.Builder<String, DateTimeFormatter>()\n        .maximumWeightedCapacity(MAX_FORMATTERS_CACHE_SIZE)\n        .build();\n```\n\nAlternatively, since `@Format` pattern values come from static annotations (a bounded, compile-time set), the locale should be excluded from the cache key and applied at use-time instead:\n\n```java\n// In getFormatter() — cache only by pattern, apply locale at use-time\nprivate DateTimeFormatter getFormatter(String pattern, ConversionContext context) {\n    DateTimeFormatter base = formattersCache.computeIfAbsent(\n        pattern, p -> DateTimeFormatter.ofPattern(p)\n    );\n    Locale locale = context.getLocale();\n    return locale != null ? base.withLocale(locale) : base;\n}\n```\n\nThis second approach bounds the cache by the number of distinct `@Format` patterns in the application, which is always small and finite, fully eliminating the attack surface.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.micronaut:micronaut-context"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.3.0"
      }, {
        "fixed" : "4.10.22"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.micronaut:micronaut-context"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.10.0"
      }, {
        "fixed" : "3.10.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.micronaut:micronaut-context"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.8.14"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/security/advisories/GHSA-8hjv-92q9-g4xj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-44241"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/commit/48f05ae8dc4157816fe0050c5cf730be7d44f8b3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/commit/c2048ab740c2efdfe227813f203176e0ef93f892"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/commit/c6ca8782de7338732e887d090f38c9e941bcb284"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/micronaut-projects/micronaut-core"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/releases/tag/v3.10.6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/releases/tag/v3.8.14"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/releases/tag/v4.10.22"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-06T20:00:22Z",
    "nvd_published_at" : "2026-05-12T22:16:35Z"
  }
}