5.9medium
Integer Overflow in Chunked Transfer-Encoding
- Severity
- 5.9medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.16% (higher than 67% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-5h46-h7hh-c6x9RUSTSEC-2021-0079
Description
hyper is an HTTP library for Rust. In versions prior to 0.14.10, hyper's HTTP server and client code had a flaw that could trigger an integer overflow when decoding chunk sizes that are too big. This allows possible data loss, or if combined with an upstream HTTP proxy that allows chunk sizes larger than hyper does, can result in "request smuggling" or "desync attacks." The vulnerability is patched in version 0.14.10. Two possible workarounds exist. One may reject requests manually that contain a `Transfer-Encoding` header or ensure any upstream proxy rejects `Transfer-Encoding` chunk sizes greater than what fits in 64-bit unsigned integers.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| hyperium hyper | < 0.14.10 | CVE List |
| hyper (crates.io) | before 0.14.10, from 0.0.0-0 before 0.14.10 | GitHub Advisory Database, RustSec Advisory Database |
| hyper hyper | before 0.14.10 | NVD |
All scores
| GitHub_M | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| RustSec Advisory Database | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H |
| NVD | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H |
| NVD | 6.4medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:P/A:P |
Classification
What each source says
CVE List
hyper is an HTTP library for Rust. In versions prior to 0.14.10, hyper's HTTP server and client code had a flaw that could trigger an integer overflow when decoding chunk sizes that are too big. This allows possible data loss, or if combined with an upstream HTTP proxy that allows chunk sizes larger than hyper does, can result in "request smuggling" or "desync attacks." The vulnerability is patched in version 0.14.10. Two possible workarounds exist. One may reject requests manually that contain a `Transfer-Encoding` header or ensure any upstream proxy rejects `Transfer-Encoding` chunk sizes greater than what fits in 64-bit unsigned integers.
GitHub Advisory Database
Summary
hyper's HTTP server and client code had a flaw that could trigger an integer overflow when decoding chunk sizes that are too big. This allows possible data loss, or if combined with an upstream HTTP proxy that allows chunk sizes larger than hyper does, can result in "request smuggling" or "desync attacks".
Vulnerability
Example:
GET / HTTP/1.1
Host: example.com
Transfer-Encoding: chunked
f0000000000000003
abc
0
hyper only reads the rightmost 64-bit integer as the chunk size. So it reads f0000000000000003 as 3. A loss of data can occur since hyper would then read only 3 bytes of the body. Additionally, an HTTP request smuggling vulnerability would occur if using a proxy which instead has prefix truncation in the chunk size, or that understands larger than 64-bit chunk sizes.
Read more about desync attacks: https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn
Impact
To determine if vulnerable to data loss, these things must be true:
- Using HTTP/1.1. Since HTTP/2 does not use chunked encoding, it is not vulnerable.
- Using hyper as a server or client. The body would be improperly truncated in either case.
- Users send requests or responses with chunk sizes greater than 18 exabytes.
To determine if vulnerable to desync attacks, these things must be true:
- Using an upstream proxy that allows chunks sizes larger than 64-bit. If the proxy rejects chunk sizes that are too large, that request won't be forwarded to hyper.
Patches
We have released the following patch versions:
- v0.14.10 (to be released when this advisory is published)
Workarounds
Besides upgrading hyper, you can take the following options:
- Reject requests manually that contain a
Transfer-Encodingheader. - Ensure any upstream proxy rejects
Transfer-Encodingchunk sizes greater than what fits in 64-bit unsigned integers.
Credits
This issue was initially reported by Mattias Grenfeldt and Asta Olofsson.
RustSec Advisory Database
When decoding chunk sizes that are too large, hyper's code would encounter an integer overflow. Depending on the situation,
this could lead to data loss from an incorrect total size, or in rarer cases, a request smuggling attack.
To be vulnerable, you must be using hyper for any HTTP/1 purpose, including as a client or server, and consumers must send
requests or responses that specify a chunk size greater than 18 exabytes. For a possible request smuggling attack to be possible,
any upstream proxies must accept a chunk size greater than 64 bits.
NVD (es)
hyper es una biblioteca HTTP para Rust. En versiones anteriores a 0.14.10, el código del servidor y del cliente HTTP de hyper presentaba un fallo que podía desencadenar un desbordamiento de enteros cuando se descodifica tamaños de trozos demasiado grandes. Esto permite una posible pérdida de datos, o si es combinado con un proxy HTTP upstream que permite tamaños de chunk más grandes que hyper, puede resultar en "request smuggling" o "desync attacks". La vulnerabilidad está parcheada en la versión 0.14.10. Se presentan dos posibles soluciones. Uno puede rechazar manualmente las peticiones que contengan una cabecera "Transfer-Encoding" o asegurarse de que cualquier proxy upstream rechaza tamaños de trozos "Transfer-Encoding" superiores a los que caben en enteros sin signo de 64 bits
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-32714 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5h46-h7hh-c6x9 changed 2026-09-10 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0079 changed 2026-10-12 | CC0-1.0 |
| NVD | CVE-2021-32714 changed 2026-06-17 | Public domain |