CVE-2023-26964: H2 Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-f8vr-r385-rh5r
CWE-770
Published
Advisory Summary

CVE-2023-26964 is a MODERATE denial of service vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting H2 libraries in the crates.io ecosystem. The issue involves h2 vulnerable to denial of service. Remediation is available by upgrading affected packages to version 0.3.17.

CVE-2023-26964 at a Glance

CVE Identifier CVE-2023-26964
GHSA Identifier GHSA-f8vr-r385-rh5r
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product H2
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix CVE-2023-26964

To remediate this vulnerability, upgrade all affected H2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

h2 fixed: 0.3.17
Upgrade h2 to 0.3.17
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for h2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-26964, inspect your project dependencies for H2:

inspect dependencies for h2

Analyze the terminal output to locate any version of H2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.17), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In H2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Hyper is an HTTP library for Rust and h2 is an HTTP 2.0 client & server implementation for Rust. An issue was discovered in h2 v0.2.4 when processing header frames. It incorrectly processes the HTTP2 `RST_STREAM` frames by not always releasing the memory immediately upon receiving the reset frame, leading to stream stacking. As a result, the memory and CPU usage are high which can lead to a Denial of Service (DoS). This issue affects users only when dealing with http2 connections.

CVE-2023-26964 Affected H2 Versions

1 component(s)
Fixed Versions:
0.3.17
Product / Package Ecosystem Affected Versions Fixed Version
h2
crates.io
< 0.3.17
0.3.17

References

Frequently Asked Questions

What is CVE-2023-26964?
CVE-2023-26964 is a security vulnerability in H2 involving h2 vulnerable to denial of service under CWE-770: Allocation of Resources Without Limits or Throttling.
Which H2 versions are affected?
Affected versions include releases prior to 0.3.17 across affected packages: h2.
What version fixes CVE-2023-26964?
Upgrading to 0.3.17 (or the latest patched release for your respective branch) resolves the vulnerability.
Is h2 affected?
Yes, h2 is affected in releases prior to 0.3.17. Upgrade your dependency to 0.3.17 or later.
What CWE is associated with CVE-2023-26964?
CVE-2023-26964 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check crates.io dependencies for CVE-2023-26964?
Run the dependency tree command: 'inspect dependencies for h2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f8vr-r385-rh5r",
  "modified" : "2023-05-01T21:22:01Z",
  "published" : "2023-04-11T15:30:30Z",
  "aliases" : [ "CVE-2023-26964" ],
  "summary" : "h2 vulnerable to denial of service",
  "details" : "Hyper is an HTTP library for Rust and h2 is an HTTP 2.0 client & server implementation for Rust. An issue was discovered in h2 v0.2.4 when processing header frames. It incorrectly processes the HTTP2 `RST_STREAM` frames by not always releasing the memory immediately upon receiving the reset frame, leading to stream stacking. As a result, the memory and CPU usage are high which can lead to a Denial of Service (DoS).\n\nThis issue affects users only when dealing with http2 connections.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "h2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.17"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-26964"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hyperium/h2/issues/621"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hyperium/hyper/issues/2877"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hyperium/h2/pull/668"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hyperium/hyper"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0034.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-04-11T21:47:01Z",
    "nvd_published_at" : "2023-04-11T14:15:00Z"
  }
}