Vulnerabilities in pkg:maven/io.micronaut/micronaut-http

PACKAGE
Advisory Identifier: GHSA-2457-2263-mm9f
Advisory Summary

CVE-2022-21700 is a MODERATE (CVSS 5.3) memory leak vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Micronaut http libraries in the Maven ecosystem. The issue involves memory leak in micronaut-core. Remediation is available by upgrading affected packages to version 3.2.7.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/io.micronaut/micronaut-http

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/io.micronaut/micronaut-http. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-2457-2263-mm9f CVE-2022-21700 MODERATE Memory leak in micronaut-core

CVE-2022-21700 at a Glance

CVE Identifier CVE-2022-21700
GHSA Identifier GHSA-2457-2263-mm9f
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Micronaut http
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:L).

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 Low (A:L)

How to Fix CVE-2022-21700

To remediate this vulnerability, upgrade all affected Micronaut http 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-http fixed: 3.2.7
<dependency>
    <groupId>io.micronaut</groupId>
    <artifactId>micronaut-http</artifactId>
    <version>3.2.7</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-2022-21700, 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 http in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.7), 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 http, 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

### 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)

CVE-2022-21700 Affected Micronaut http Versions

1 component(s)
Fixed Versions:
3.2.7
Product / Package Ecosystem Affected Versions Fixed Version
io.micronaut:micronaut-http
Maven
< 3.2.7
3.2.7

References

Frequently Asked Questions

What is CVE-2022-21700?
CVE-2022-21700 is a security vulnerability in Micronaut http involving Memory leak in micronaut-core under CWE-400: Uncontrolled Resource Consumption.
Which Micronaut http versions are affected?
Affected versions include releases prior to 3.2.7 across affected packages: io.micronaut:micronaut-http.
What version fixes CVE-2022-21700?
Upgrading to 3.2.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is micronaut-http affected?
Yes, io.micronaut:micronaut-http is affected in releases prior to 3.2.7. Upgrade your dependency to 3.2.7 or later.
What is the CVSS score of CVE-2022-21700?
CVE-2022-21700 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2022-21700?
CVE-2022-21700 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-2022-21700?
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-2457-2263-mm9f",
  "modified" : "2022-01-19T19:56:29Z",
  "published" : "2022-01-21T23:19:36Z",
  "aliases" : [ "CVE-2022-21700" ],
  "summary" : "Memory leak in micronaut-core",
  "details" : "### Impact\n\nSending an invalid Content Type header leads to memory leak in `DefaultArgumentConversionContext` as this type is erroneously used in static state.\n\n### Patches\n\nThe problem is patched in Micronaut 3.2.7 and above.\n\n### Workarounds\n\nThe default content type binder can be replaced in an existing Micronaut application to mitigate the issue:\n\n```java\npackage example;\n\nimport java.util.List;\nimport io.micronaut.context.annotation.Replaces;\nimport io.micronaut.core.convert.ConversionService;\nimport io.micronaut.http.MediaType;\nimport io.micronaut.http.bind.DefaultRequestBinderRegistry;\nimport io.micronaut.http.bind.binders.RequestArgumentBinder;\nimport jakarta.inject.Singleton;\n\n@Singleton\n@Replaces(DefaultRequestBinderRegistry.class)\nclass FixedRequestBinderRegistry extends DefaultRequestBinderRegistry {\n\n    public FixedRequestBinderRegistry(ConversionService conversionService,\n                                      List<RequestArgumentBinder> binders) {\n        super(conversionService, binders);\n    }\n\n    @Override\n    protected void registerDefaultConverters(ConversionService<?> conversionService) {\n        super.registerDefaultConverters(conversionService);\n        conversionService.addConverter(CharSequence.class, MediaType.class, charSequence -> {\n            try {\n                return MediaType.of(charSequence);\n            } catch (IllegalArgumentException e) {\n                return null;\n            }\n        });\n    }\n}\n```\n\n### References\n\nCommit that introduced the vulnerability https://github.com/micronaut-projects/micronaut-core/commit/b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [Micronaut Core](https://github.com/micronaut-projects/micronaut-core/issues)\n* Email us at [info@micronaut.io](mailto:info@micronaut.io)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.micronaut:micronaut-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/security/advisories/GHSA-2457-2263-mm9f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21700"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/commit/b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-19T19:56:29Z",
    "nvd_published_at" : "2022-01-18T23:15:00Z"
  }
}