# CVE-2022-21700: Memory leak in micronaut-core

> Attackers can cause a memory leak and potential denial of service by sending invalid Content Type headers to applications using the Micronaut framework.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Jan 2022
- **Updated:** 23 Apr 2025
- **Also known as:** GHSA-2457-2263-mm9f

## What is CVE-2022-21700?

CVE-2022-21700 is a medium-severity denial of service vulnerability in micronaut-projects micronaut-core, published on 18 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Micronaut is a JVM-based, full stack Java framework designed for building JVM web applications with support for Java, Kotlin and the Groovy language. In affected versions sending an invalid Content Type header leads to memory leak in DefaultArgumentConversionContext as this type is erroneously used in static state. ### Impact Sending an invalid Content Type header leads to memory leak in `DefaultArgumentConversionContext` as this type is erroneously used in static state. ### Patches The problem is patched in Micronaut 3.2.7 and above. ### Workarounds The default content type binder can be replaced in an existing Micronaut application to mitigate the issue: ```java package example; import java.util.List; import io.micronaut.context.annotation.Replaces; import io.micronaut.core.convert.ConversionService; import io.micronaut.http.MediaType; import io.micronaut.http.bind.DefaultRequestBinderRegistry; import io.micronaut.http.bind.binders.RequestArgumentBinder; import jakarta.inject.Singleton; @Singleton @Replaces(DefaultRequestBinderRegistry.class) class FixedRequestBinderRegistry extends DefaultRequestBinderRegistry { public FixedRequestBinderRegistry(ConversionService conversionService, List<RequestArgumentBinder> binders) { super(conversionService, binders); } @Override protected void registerDefaultConverters(ConversionService<?> conversionService) { super.registerDefaultConverters(conversionService); conversionService.addConverter(CharSequence.class, MediaType.class, charSequence -> { try { return MediaType.of(charSequence); } catch (IllegalArgumentException e) { return null; } }); } } ``` ### References Commit that introduced the vulnerability https://github.com/micronaut-projects/micronaut-core/commit/b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3 ### For more information If you have any questions or comments about this advisory: * Open an issue in [Micronaut Core](https://github.com/micronaut-projects/micronaut-core/issues) * Email us at [info@micronaut.io](mailto:info@micronaut.io)

Weakness: CWE-400 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2022-21700?

2 open source packages ship an affected version, including io.micronaut:micronaut-http. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `io.micronaut:micronaut-http` | Maven | All versions | 3.2.7 |
| `io.micronaut:micronaut-http` | Maven | All versions | 3.2.7 |

Products: Objectcomputing Micronaut.

## How do I fix CVE-2022-21700?

Upgrade io.micronaut:micronaut-http to 3.2.7 or later.

## Is CVE-2022-21700 being exploited?

There is no known exploitation of CVE-2022-21700 in the wild and no public exploit code.

## Other vulnerabilities in micronaut-projects micronaut-core

- [CVE-2020-7611](https://insights.sbomify.com/CVE-2020-7611/): Micronaut's HTTP client is vulnerable to HTTP Request Header Injection (critical 9.8)
- [CVE-2026-33013](https://insights.sbomify.com/CVE-2026-33013/): Micronaut vulnerable to DoS via crafted form-urlencoded body binding with descending array indices (high 8.2)
- [CVE-2026-33012](https://insights.sbomify.com/CVE-2026-33012/): Micronaut Framework vulnerable to a Denial of Service in HTML error response caching (high 7.5)
- [CVE-2021-32769](https://insights.sbomify.com/CVE-2021-32769/): Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in micronaut-core (high 7.5)
- [CVE-2024-23639](https://insights.sbomify.com/CVE-2024-23639/): micronaut-core management endpoints vulnerable to drive-by localhost attack (medium 5.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-21700 and fix it if it is affected.

What it is: CVE-2022-21700 is a medium-severity denial of service vulnerability in micronaut-projects micronaut-core, published on 18 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-21700 in the wild and no public exploit code.

Affected packages and fixed versions:
- io.micronaut:micronaut-http (Maven): affected all versions; fixed in 3.2.7
- io.micronaut:micronaut-http (Maven): affected all versions; fixed in 3.2.7

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-21700/ (Markdown: https://insights.sbomify.com/CVE-2022-21700/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-21700
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-21700
- OSV: https://osv.dev/vulnerability/CVE-2022-21700

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-21700/
Summaries are generated and may contain mistakes; the official description above is the record.
