{"id":"CVE-2021-32715","aliases":["CVE-2021-32715","GHSA-f3pg-qwvg-p99c","RUSTSEC-2021-0078"],"related":[],"kind":"vulnerability","state":"published","title":"Lenient Parsing of Content-Length Header When Prefixed with Plus Sign","summary":"hyper is an HTTP library for rust. 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\". The flaw exists in all prior versions of hyper prior to 0.14.10, if built with `rustc` v1.5.0 or newer. The vulnerability is patched in hyper version 0.14.10. Two workarounds exist: One may reject requests manually that contain a plus sign prefix in the `Content-Length` header or ensure any upstream proxy handles `Content-Length` headers with a plus sign prefix.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"hyper is an HTTP library for rust. 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\". The flaw exists in all prior versions of hyper prior to 0.14.10, if built with `rustc` v1.5.0 or newer. The vulnerability is patched in hyper version 0.14.10. Two workarounds exist: One may reject requests manually that contain a plus sign prefix in the `Content-Length` header or ensure any upstream proxy handles `Content-Length` headers with a plus sign prefix.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nhyper'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\".\n\n### Vulnerability\n\nThe flaw exists in all prior versions of hyper, if built with [`rustc` v1.5.0 or newer](https://github.com/rust-lang/rust/pull/28826/commits/123a83326fb95366e94a3be1a74775df4db97739).\n\nExample:\n\n```\nGET / HTTP/1.1\nHost: example.com\nContent-Length: +3\n\nabc\n```\n\nThis 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 `DIGIT`s. 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\".\n\nIn 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.\n\nRead more about desync attacks: https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn\n\n### Impact\n\nTo determine if vulnerable, all these things must be true:\n\n- **Using hyper as an HTTP server**. While the lenient decoder also exists in the client, a vulnerability does not exist around _responses_.\n- **Using HTTP/1**. The HTTP/2 code uses a stricter parser.\n- **Using a vulnerable HTTP proxy upstream to hyper**. If an upstream proxy correctly rejects the illegal `Content-Length` header, *OR* can parse the length with the plus sign, the desync attack cannot succeed.\n\n### Patches\n\nWe have released the following patch versions:\n\n- v0.14.10 (to be released when this advisor is published)\n\n### Workarounds\n\nBesides upgrading hyper, you can take the following options:\n\n- Reject requests manually that contain a plus sign prefix in the `Content-Length` header.\n- Ensure any upstream proxy handles `Content-Length` headers with a plus sign prefix.\n\n### Credits\nThis issue was initially reported by [Mattias Grenfeldt](https://grenfeldt.dev/) and Asta Olofsson.","format":"markdown","source":"ghsa"},{"lang":"en","text":"`hyper`'s HTTP header parser accepted, according to RFC 7230, illegal contents inside `Content-Length` headers.\nDue to this, upstream HTTP proxies that ignore the header may still forward them along if it chooses to ignore the error.\n\nTo be vulnerable, `hyper` must be used as an HTTP/1 server and using an HTTP proxy upstream that ignores the header's contents\nbut still forwards it. Due to all the factors that must line up, an attack exploiting this vulnerability is unlikely.","format":"markdown","source":"rustsec"},{"lang":"es","text":"El código del servidor HTTP/1 de hyper presentaba un fallo que analizaba y aceptaba incorrectamente peticiones con una cabecera \"Content-Length\" con un signo más prefijado, cuando debería haber sido rechazada como ilegal. Esto, combinado con un proxy HTTP ascendente que no analiza dichas cabeceras \"Content-Length\", sino que las reenvía, puede resultar en \"request smuggling\" o \"desync attacks\". El fallo se presenta en todas las versiones de hyper anteriores a 0.14.10, si se construye con \"rustc\" versión v1.5.0 o más reciente. La vulnerabilidad está parcheada en la versión 0.14.10 de hyper. Se presentan dos soluciones: Uno puede rechazar manualmente las peticiones que contengan un prefijo de signo más en la cabecera \"Content-Length\" o asegurarse de que cualquier proxy upstream maneja las cabeceras \"Content-Length\" con un prefijo de signo más","source":"nvd"}],"published":"2021-07-07T12:00:00.000Z","modified":"2026-10-12T18:00:03.463Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N","score":3.1,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N","score":3.1,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N","score":3.1,"rating":"LOW"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-444"],"affected":[{"ranges":[{"version":"< 0.14.10","status":"affected"}],"vendor":"hyperium","product":"hyper","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.14.10"}],"ecosystem":"crates.io","package":"hyper","purl":"pkg:cargo/hyper","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.14.10"}],"ecosystem":"crates.io","package":"hyper","purl":"pkg:cargo/hyper","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.14.10"}],"vendor":"hyper","product":"hyper","cpe":"cpe:2.3:a:hyper:hyper:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/hyperium/hyper/security/advisories/GHSA-f3pg-qwvg-p99c","tags":["exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rust-lang/rust/pull/28826/commits/123a83326fb95366e94a3be1a74775df4db97739","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32715","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/hyperium/hyper/commit/1fb719e0b61a4f3d911562a436a2ff05fd7cb759","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/hyperium/hyper","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0078.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/hyper","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-32715","url":"https://www.cve.org/CVERecord?id=CVE-2021-32715","licence":"CVE Terms of Use","modified":"2024-08-03T23:25:31.081Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f3pg-qwvg-p99c","url":"https://github.com/advisories/GHSA-f3pg-qwvg-p99c","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:06.257Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0078","url":"https://rustsec.org/advisories/RUSTSEC-2021-0078.html","licence":"CC0-1.0","modified":"2026-10-12T18:00:03.463Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-32715","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32715","licence":"Public domain","modified":"2026-06-17T03:53:29.050Z"}],"updatedAt":"2026-11-25T22:58:02.468Z","epss":{"score":0.01126,"percentile":0.67223,"date":"2026-12-01T12:00:22.000Z"}}