Skip to content
Heist/ feed
Back to feed
High

rust-hyper — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2021-21299

hyper is an open-source HTTP library for Rust (crates.io). In hyper from version 0.12.0 and before versions 0.13.10 and 0.14.3 there is a vulnerability that can enable a request smuggling attack. The HTTP server code had a flaw that incorrectly understands some requests with multiple transfer-encoding headers to have a chunked payload, when it should have been rejected as illegal. This combined with an upstream HTTP proxy that understands the request payload boundary differently can result in "request smuggling" or "desync attacks". To determine if vulnerable, all these things must be true: 1) Using hyper as an HTTP server (the client is not affected), 2) Using HTTP/1.1 (HTTP/2 does not use transfer-encoding), 3) Using a vulnerable HTTP proxy upstream to hyper. If an upstream proxy correctly rejects the illegal transfer-encoding headers, the desync attack cannot succeed. If there is no proxy upstream of hyper, hyper cannot start the desync attack, as the client will repair the headers before forwarding. This is fixed in versions 0.14.3 and 0.13.10. As a workaround one can take the following options: 1) Reject requests that contain a `transfer-encoding` header, 2) Ensure any upstream proxy handles `transfer-encoding` correctly.

Products
rust-hyper
Affected versions
0.12.35-1, 0.14.25-1, 0.14.27-1, 1.5.2-1, 1.7.0-1, 1.8.1-1
Fixed versions
Not specified
CVEs
CVE-2021-21299
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 00:58 UTC · Revision 1

Source evidence

UBUNTU-CVE-2021-21299

core-osv · Original source

Published 11 Feb 2021, 18:15 UTC

hyper is an open-source HTTP library for Rust (crates.io). In hyper from version 0.12.0 and before versions 0.13.10 and 0.14.3 there is a vulnerability that can enable a request smuggling attack. The HTTP server code had a flaw that incorrectly understands some requests with multiple transfer-encoding headers to have a chunked payload, when it should have been rejected as illegal. This combined with an upstream HTTP proxy that understands the request payload boundary differently can result in "request smuggling" or "desync attacks". To determine if vulnerable, all these things must be true: 1) Using hyper as an HTTP server (the client is not affected), 2) Using HTTP/1.1 (HTTP/2 does not use transfer-encoding), 3) Using a vulnerable HTTP proxy upstream to hyper. If an upstream proxy correctly rejects the illegal transfer-encoding headers, the desync attack cannot succeed. If there is no proxy upstream of hyper, hyper cannot start the desync attack, as the client will repair the headers before forwarding. This is fixed in versions 0.14.3 and 0.13.10. As a workaround one can take the following options: 1) Reject requests that contain a `transfer-encoding` header, 2) Ensure any upstream proxy handles `transfer-encoding` correctly.

osv:UBUNTU-CVE-2021-21299

rust-hyper

Fixed versions: Not specified

rust-hyper

Fixed versions: Not specified

rust-hyper

Fixed versions: Not specified

rust-hyper

Fixed versions: Not specified

rust-hyper

Fixed versions: Not specified

Complete source record
{
  "id": "56232b7a36991921525de30288ff349295c0fcac225e4e6282d2f463f887be41",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2021-21299",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2021-21299",
    "summary": "hyper is an open-source HTTP library for Rust (crates.io). In hyper from version 0.12.0 and before versions 0.13.10 and 0.14.3 there is a vulnerability that can enable a request smuggling attack. The HTTP server code had a flaw that incorrectly understands some requests with multiple transfer-encoding headers to have a chunked payload, when it should have been rejected as illegal. This combined with an upstream HTTP proxy that understands the request payload boundary differently can result in \"request smuggling\" or \"desync attacks\". To determine if vulnerable, all these things must be true: 1) Using hyper as an HTTP server (the client is not affected), 2) Using HTTP/1.1 (HTTP/2 does not use transfer-encoding), 3) Using a vulnerable HTTP proxy upstream to hyper. If an upstream proxy correctly rejects the illegal transfer-encoding headers, the desync attack cannot succeed. If there is no proxy upstream of hyper, hyper cannot start the desync attack, as the client will repair the headers before forwarding. This is fixed in versions 0.14.3 and 0.13.10. As a workaround one can take the following options: 1) Reject requests that contain a `transfer-encoding` header, 2) Ensure any upstream proxy handles `transfer-encoding` correctly.",
    "evidence": "osv:UBUNTU-CVE-2021-21299",
    "products": [
      {
        "name": {
          "value": "rust-hyper",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.12.35-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "rust-hyper",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.14.25-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "0.14.27-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "rust-hyper",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.5.2-1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "rust-hyper",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.8.1-1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "rust-hyper",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.5.2-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.7.0-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.8.1-1",
            "evidence": "/affected/4/versions"
          }
        ]
      }
    ],
    "severity": "high",
    "structured": {
      "id": "UBUNTU-CVE-2021-21299",
      "aliases": [
        "UBUNTU-CVE-2021-21299"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
        },
        {
          "type": "Ubuntu",
          "score": "low"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-hyper",
            "purl": "pkg:deb/ubuntu/rust-hyper?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "0.12.35-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21299.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-hyper+default-dev",
                "binary_version": "0.12.35-1"
              },
              {
                "binary_name": "librust-hyper+futures-cpupool-dev",
                "binary_version": "0.12.35-1"
              },
              {
                "binary_name": "librust-hyper+net2-dev",
                "binary_version": "0.12.35-1"
              },
              {
                "binary_name": "librust-hyper+runtime-dev",
                "binary_version": "0.12.35-1"
              },
              {
                "binary_name": "librust-hyper+tokio-dev",
                "binary_version": "0.12.35-1"
              },
              {
                "binary_name": "librust-hyper+tokio-executor-dev",
                "binary_version": "0.12.35-1"
              },
              {
                "binary_name": "librust-hyper+tokio-reactor-dev",
                "binary_version": "0.12.35-1"
              },
              {
                "binary_name": "librust-hyper+tokio-tcp-dev",
                "binary_version": "0.12.35-1"
              },
              {
                "binary_name": "librust-hyper+tokio-threadpool-dev",
                "binary_version": "0.12.35-1"
              },
              {
                "binary_name": "librust-hyper+tokio-timer-dev",
                "binary_version": "0.12.35-1"
              },
              {
                "binary_name": "librust-hyper-dev",
                "binary_version": "0.12.35-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-hyper",
            "purl": "pkg:deb/ubuntu/rust-hyper?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "0.14.25-1",
            "0.14.27-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21299.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-hyper-dev",
                "binary_version": "0.14.27-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-hyper",
            "purl": "pkg:deb/ubuntu/rust-hyper?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "1.5.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21299.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-hyper-dev",
                "binary_version": "1.5.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-hyper",
            "purl": "pkg:deb/ubuntu/rust-hyper?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "1.8.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21299.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-hyper-dev",
                "binary_version": "1.8.1-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "rust-hyper",
            "purl": "pkg:deb/ubuntu/rust-hyper?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "1.5.2-1",
            "1.7.0-1",
            "1.8.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-21299.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "librust-hyper-dev",
                "binary_version": "1.8.1-1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:56:19.514235719Z",
      "provider": "osv",
      "upstream": [
        "CVE-2021-21299"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2021-21299",
        "https://github.com/hyperium/hyper/security/advisories/GHSA-6hfq-h8hq-87mf",
        "https://rustsec.org/advisories/RUSTSEC-2021-0020.html",
        "https://crates.io/crates/hyper",
        "https://github.com/hyperium/hyper/commit/8f93123efef5c1361086688fe4f34c83c89cec02",
        "https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn",
        "https://www.cve.org/CVERecord?id=CVE-2021-21299"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2021-21299",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/1/score"
  },
  "source_id": "core-osv",
  "document_id": 355264,
  "published_at": "2021-02-11T18:15:00+00:00"
}