Skip to content

CVE-2022-21700 (Medium) detected in micronaut-core-2.0.0.jar, micronaut-core-2.5.13.jar - autoclosed #485

@mend-for-github-com

Description

@mend-for-github-com

CVE-2022-21700 - Medium Severity Vulnerability

Vulnerable Libraries - micronaut-core-2.0.0.jar, micronaut-core-2.5.13.jar

micronaut-core-2.0.0.jar

Natively Cloud Native

Library home page: http://micronaut.io

Path to dependency file: /dd-java-agent/instrumentation/micronaut-http-server-netty-2/micronaut-http-server-netty-2.gradle

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-core/2.0.0/d3eaa045820cd59eca8508d5f8faa5187352d61e/micronaut-core-2.0.0.jar

Dependency Hierarchy:

  • micronaut-inject-java-2.0.0.jar (Root Library)
    • micronaut-inject-2.0.0.jar
      • micronaut-core-2.0.0.jar (Vulnerable Library)
micronaut-core-2.5.13.jar

Natively Cloud Native

Library home page: http://micronaut.io

Path to dependency file: /dd-java-agent/instrumentation/micronaut-http-server-netty-2/micronaut-http-server-netty-2.gradle

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-core/2.5.13/288a4d9517de47e6f8e5ee6e31b9593cdd72b1db/micronaut-core-2.5.13.jar

Dependency Hierarchy:

  • micronaut-http-server-netty-2.5.13.jar (Root Library)
    • micronaut-core-2.5.13.jar (Vulnerable Library)

Found in HEAD commit: 2819174635979a19573ec0ce8e3e2b63a3848079

Found in base branch: master

Vulnerability Details

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 micronaut-projects/micronaut-core@b8ec32c ### For more information If you have any questions or comments about this advisory: * Open an issue in Micronaut Core * Email us at info@micronaut.io

Publish Date: 2022-01-18

URL: CVE-2022-21700

CVSS 3 Score Details (5.3)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: Low

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21700

Release Date: 2022-01-18

Fix Resolution (io.micronaut:micronaut-core): 3.2.7

Direct dependency fix Resolution (io.micronaut:micronaut-inject-java): 3.2.7

Fix Resolution (io.micronaut:micronaut-core): 3.2.7

Direct dependency fix Resolution (io.micronaut:micronaut-http-server-netty): 3.2.7


⛑️ Automatic Remediation is available for this issue

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions