Summary
Lenient Parsing of Content-Length Header When Prefixed with Plus Sign
hyper's HTTP/1 server code had a flaw that incorrectly parses and accepts requests with a Content-Length header with a prefixed plus sign, when it should have been rejected as illegal. This combined with an upstream HTTP proxy that doesn't parse such Content-Length headers, but forwards them, can result in "request smuggling" or "desync attacks".
Vulnerability
The flaw exists in all prior versions of hyper, if built with rustc v1.5.0 or newer.
Example:
GET / HTTP/1.1
Host: example.com
Content-Length: +3
abc
This request gets accepted and hyper reads the body as abc. The request should be rejected, according to RFC 7230, since the ABNF for Content-Length only allows for DIGITs. This is due to using the FromStr implementation for u64 in the standard library. By differing from the spec, it is possible to send requests like these to endpoints that have different HTTP implementations, with different interpretations of the payload semantics, and cause "desync attacks".
In this particular case, an upstream proxy would need to error when parsing the Content-Length, but not reject the request (swallowing its own error), and forwarding the request as-is with the Content-Length still included. Then the upstream proxy and hyper would disagree on the length of the request body. The combination of these factors would be extremely rare.
Read more about desync attacks: https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn
Workarounds
Besides upgrading hyper, you can take the following options:
- Reject requests manually that contain a plus sign prefix in the
Content-Lengthheader. - Ensure any upstream proxy handles
Content-Lengthheaders with a plus sign prefix.
Credits
This issue was initially reported by Mattias Grenfeldt and Asta Olofsson.
Impact
To determine if vulnerable, all these things must be true:
- Using hyper as an HTTP server. While the lenient decoder also exists in the client, a vulnerability does not exist around responses.
- Using HTTP/1. The HTTP/2 code uses a stricter parser.
- Using a vulnerable HTTP proxy upstream to hyper. If an upstream proxy correctly rejects the illegal
Content-Lengthheader, OR can parse the length with the plus sign, the desync attack cannot succeed.
CVE-2021-32715 has a CVSS score of 3.1 (Low). The vector is network-reachable, no privileges required, and user interaction required. 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 (0.14.10); 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
We have released the following patch versions:
- v0.14.10 (to be released when this advisor is published)
Frequently Asked Questions
- What is CVE-2021-32715? CVE-2021-32715 is a low-severity security vulnerability in hyper (rust), affecting versions < 0.14.10. It is fixed in 0.14.10.
- How severe is CVE-2021-32715? CVE-2021-32715 has a CVSS score of 3.1 (Low). 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 hyper are affected by CVE-2021-32715? hyper (rust) versions < 0.14.10 is affected.
- Is there a fix for CVE-2021-32715? Yes. CVE-2021-32715 is fixed in 0.14.10. Upgrade to this version or later.
- Is CVE-2021-32715 exploitable, and should I be worried? Whether CVE-2021-32715 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-2021-32715 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-2021-32715? Upgrade
hyperto 0.14.10 or later.