From b48cd7fdae0bbfc131a1857278c5192974ad089f Mon Sep 17 00:00:00 2001 From: "advisory-database[bot]" <45398580+advisory-database[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:09:24 +0000 Subject: [PATCH] Publish GHSA-694p-xrhg-x3wm --- .../2020/03/GHSA-694p-xrhg-x3wm/GHSA-694p-xrhg-x3wm.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advisories/github-reviewed/2020/03/GHSA-694p-xrhg-x3wm/GHSA-694p-xrhg-x3wm.json b/advisories/github-reviewed/2020/03/GHSA-694p-xrhg-x3wm/GHSA-694p-xrhg-x3wm.json index 8b249ce9cf3..0a2a49f8dec 100644 --- a/advisories/github-reviewed/2020/03/GHSA-694p-xrhg-x3wm/GHSA-694p-xrhg-x3wm.json +++ b/advisories/github-reviewed/2020/03/GHSA-694p-xrhg-x3wm/GHSA-694p-xrhg-x3wm.json @@ -1,12 +1,12 @@ { "schema_version": "1.4.0", "id": "GHSA-694p-xrhg-x3wm", - "modified": "2021-10-06T21:44:23Z", + "modified": "2023-11-06T11:08:02Z", "published": "2020-03-30T20:54:55Z", "aliases": [ "CVE-2020-7611" ], - "summary": "CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request Header Injection')", + "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 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 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": [ {