CVE-2020-7611: Micronaut http client Micronaut's HTTP Client Is Vulnerable Vulnerability

CRITICAL
Advisory Identifier: GHSA-694p-xrhg-x3wm
CVSS 9.8
CWE-444
Published
Advisory Summary

CVE-2020-7611 is a CRITICAL (CVSS 9.8) micronaut's http client is vulnerable vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting Micronaut http client libraries in the Maven ecosystem. The issue involves micronaut's http client is vulnerable to http request header injection. Remediation is available by upgrading affected packages to version 1.2.11, 1.3.2.

CVE-2020-7611 at a Glance

CVE Identifier CVE-2020-7611
GHSA Identifier GHSA-694p-xrhg-x3wm
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
Affected Product Micronaut http client
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2020-7611

To remediate this vulnerability, upgrade all affected Micronaut http client 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-client fixed: 1.2.11
<dependency>
    <groupId>io.micronaut</groupId>
    <artifactId>micronaut-http-client</artifactId>
    <version>1.2.11</version>
</dependency>
io.micronaut:micronaut-http-client fixed: 1.3.2
<dependency>
    <groupId>io.micronaut</groupId>
    <artifactId>micronaut-http-client</artifactId>
    <version>1.3.2</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-2020-7611, 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 client in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.11), 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-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'), where the product acts as an intermediary http agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed http requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination. In Micronaut http client, 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

### Vulnerability Micronaut's HTTP client is vulnerable to "HTTP Request Header Injection" due to not validating request headers passed to the client. Example of vulnerable code: ```java @Controller("/hello") public class HelloController { @Inject @Client("/") RxHttpClient client; @Get("/external-exploit") @Produces(MediaType.TEXT_PLAIN) public String externalExploit(@QueryValue("header-value") String headerValue) { return client.toBlocking().retrieve( HttpRequest.GET("/hello") .header("Test", headerValue) ); } } ``` In the above case a query value received from a user is passed as a header value to the client. Since the client doesn't validate the header value the request headers and body have the potential to be manipulated. For example, a user that supplies the following payload, can force the client to make multiple attacker-controlled HTTP requests. ```java List<String> headerData = List.of( "Connection: Keep-Alive", // This keeps the connection open so another request can be stuffed in. "", "", "POST /hello/super-secret HTTP/1.1", "Host: 127.0.0.1", "Content-Length: 31", "", "{\"new\":\"json\",\"content\":\"here\"}", "", "" ); String headerValue = "H\r\n" + String.join("\r\n", headerData);; URI theURI = UriBuilder .of("/hello/external-exploit") .queryParam("header-value", headerValue) // Automatically URL encodes data .build(); HttpRequest<String> request = HttpRequest.GET(theURI); String body = client.toBlocking().retrieve(request); ``` Note that using `@HeaderValue` instead of `@QueryValue` is not vulnerable since Micronaut's HTTP server does validate the headers passed to the server, so the exploit can only be triggered by using user data that is not an HTTP header (query values, form data etc.). ### Impact The attacker is able to control the entirety of the HTTP body for their custom requests. As such, this vulnerability enables attackers to perform a variant of [Server Side Request Forgery](https://cwe.mitre.org/data/definitions/918.html). ### Patches The problem has been patched in the `micronaut-http-client` versions 1.2.11 and 1.3.2 and above. ### Workarounds Do not pass user data directly received from HTTP request parameters as headers in the HTTP client. ### References Fix commits - https://github.com/micronaut-projects/micronaut-core/commit/9d1eff5c8df1d6cda1fe00ef046729b2a6abe7f1 - https://github.com/micronaut-projects/micronaut-core/commit/6deb60b75517f80c57b42d935f07955c773b766d - https://github.com/micronaut-projects/micronaut-core/commit/bc855e439c4a5ced3d83195bb59d0679cbd95add ### 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) * Email us at [info@micronaut.io](mailto:info@micronaut.io) ### Credit Originally reported by @JLLeitschuh

CVE-2020-7611 Affected Micronaut http client Versions

2 component(s)
Fixed Versions:
1.2.111.3.2
Product / Package Ecosystem Affected Versions Fixed Version
io.micronaut:micronaut-http-client
Maven
< 1.2.11
1.2.11
io.micronaut:micronaut-http-client
Maven
≥ 1.3.0
< 1.3.2
1.3.2

References

Frequently Asked Questions

What is CVE-2020-7611?
CVE-2020-7611 is a security vulnerability in Micronaut http client involving Micronaut's HTTP client is vulnerable to HTTP Request Header Injection under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling').
Which Micronaut http client versions are affected?
Affected versions include releases prior to 1.2.11, 1.3.2 across affected packages: io.micronaut:micronaut-http-client.
What version fixes CVE-2020-7611?
Upgrading to 1.2.11, 1.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is micronaut-http-client affected?
Yes, io.micronaut:micronaut-http-client is affected in releases prior to 1.2.11, 1.3.2. Upgrade your dependency to 1.2.11, 1.3.2 or later.
What is the CVSS score of CVE-2020-7611?
CVE-2020-7611 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-7611?
CVE-2020-7611 is classified under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') (The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination.).
How can I check Maven dependencies for CVE-2020-7611?
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-694p-xrhg-x3wm",
  "modified" : "2023-11-06T11:08:02Z",
  "published" : "2020-03-30T20:54:55Z",
  "aliases" : [ "CVE-2020-7611" ],
  "summary" : "Micronaut's HTTP client is vulnerable to HTTP Request Header Injection",
  "details" : "### Vulnerability\n\nMicronaut's HTTP client is vulnerable to \"HTTP Request Header Injection\" due to not validating request headers passed to the client.\n\nExample of vulnerable code:\n\n```java\n@Controller(\"/hello\")\npublic class HelloController {\n\n    @Inject\n    @Client(\"/\")\n    RxHttpClient client;\n\n    @Get(\"/external-exploit\")\n    @Produces(MediaType.TEXT_PLAIN)\n    public String externalExploit(@QueryValue(\"header-value\") String headerValue) {\n        return client.toBlocking().retrieve(\n            HttpRequest.GET(\"/hello\")\n                .header(\"Test\", headerValue)\n        );\n    }\n}\n```\n\nIn the above case a query value received from a user is passed as a header value to the client. Since the client doesn't validate the header value the request headers and body have the potential to be manipulated.\n\nFor example, a user that supplies the following payload, can force the client to make multiple attacker-controlled HTTP requests.\n\n```java\nList<String> headerData = List.of(\n    \"Connection: Keep-Alive\", // This keeps the connection open so another request can be stuffed in.\n    \"\",\n    \"\",\n    \"POST /hello/super-secret HTTP/1.1\",\n    \"Host: 127.0.0.1\",\n    \"Content-Length: 31\",\n    \"\",\n    \"{\\\"new\\\":\\\"json\\\",\\\"content\\\":\\\"here\\\"}\",\n    \"\",\n    \"\"\n);\nString headerValue = \"H\\r\\n\" + String.join(\"\\r\\n\", headerData);;\nURI theURI =\n    UriBuilder\n        .of(\"/hello/external-exploit\")\n        .queryParam(\"header-value\", headerValue) // Automatically URL encodes data\n        .build();\nHttpRequest<String> request = HttpRequest.GET(theURI);\nString body = client.toBlocking().retrieve(request);\n```\n\nNote that using `@HeaderValue` instead of `@QueryValue` is not vulnerable since Micronaut's HTTP server does validate the headers passed to the server, so the exploit can only be triggered by using user data that is not an HTTP header (query values, form data etc.).\n\n### Impact\n\nThe attacker is able to control the entirety of the HTTP body for their custom requests.\nAs such, this vulnerability enables attackers to perform a variant of [Server Side Request Forgery](https://cwe.mitre.org/data/definitions/918.html).\n\n### Patches\n\nThe problem has been patched in the `micronaut-http-client` versions 1.2.11 and 1.3.2 and above.\n\n### Workarounds\n\nDo not pass user data directly received from HTTP request parameters as headers in the HTTP client.\n\n### References\n\nFix commits\n- https://github.com/micronaut-projects/micronaut-core/commit/9d1eff5c8df1d6cda1fe00ef046729b2a6abe7f1\n- https://github.com/micronaut-projects/micronaut-core/commit/6deb60b75517f80c57b42d935f07955c773b766d\n- https://github.com/micronaut-projects/micronaut-core/commit/bc855e439c4a5ced3d83195bb59d0679cbd95add\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)\n* Email us at [info@micronaut.io](mailto:info@micronaut.io)\n\n### Credit\n\nOriginally reported by @JLLeitschuh \n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.micronaut:micronaut-http-client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.micronaut:micronaut-http-client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.3.0"
      }, {
        "fixed" : "1.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/security/advisories/GHSA-694p-xrhg-x3wm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-7611"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/commit/6deb60b75517f80c57b42d935f07955c773b766d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/commit/9d1eff5c8df1d6cda1fe00ef046729b2a6abe7f1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/micronaut-projects/micronaut-core/commit/bc855e439c4a5ced3d83195bb59d0679cbd95add"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/micronaut-projects/micronaut-core"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JAVA-IOMICRONAUT-561342"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-444" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-03-30T20:54:42Z",
    "nvd_published_at" : null
  }
}