GHSA-8r5v-vm4m-4g25: H2 Remote Code Execution Vulnerability

MODERATE
Published
Advisory Summary

GHSA-8r5v-vm4m-4g25 is a MODERATE remote code execution vulnerability (General Security Weakness) affecting H2 libraries in the crates.io ecosystem. The issue involves resource exhaustion vulnerability in h2 may lead to denial of service (dos). Remediation is available by upgrading affected packages to version 0.3.24, 0.4.2.

GHSA-8r5v-vm4m-4g25 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-8r5v-vm4m-4g25
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product H2
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-8r5v-vm4m-4g25

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.24
Upgrade h2 to 0.3.24
h2 fixed: 0.4.2
Upgrade h2 to 0.4.2
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 GHSA-8r5v-vm4m-4g25, 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.24), 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 General Security Weakness. 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

An attacker with an HTTP/2 connection to an affected endpoint can send a steady stream of invalid frames to force the generation of reset frames on the victim endpoint. By closing their recv window, the attacker could then force these resets to be queued in an unbounded fashion, resulting in Out Of Memory (OOM) and high CPU usage. This fix is corrected in [hyperium/h2#737](https://github.com/hyperium/h2/pull/737), which limits the total number of internal error resets emitted by default before the connection is closed.

GHSA-8r5v-vm4m-4g25 Affected H2 Versions

2 component(s)
Fixed Versions:
0.3.240.4.2
Product / Package Ecosystem Affected Versions Fixed Version
h2
crates.io
< 0.3.24
0.3.24
h2
crates.io
≥ 0.4.0
< 0.4.2
0.4.2

References

Frequently Asked Questions

What is GHSA-8r5v-vm4m-4g25?
GHSA-8r5v-vm4m-4g25 is a security vulnerability in H2 involving Resource exhaustion vulnerability in h2 may lead to Denial of Service (DoS) under General Security Weakness.
Which H2 versions are affected?
Affected versions include releases prior to 0.3.24, 0.4.2 across affected packages: h2.
What version fixes GHSA-8r5v-vm4m-4g25?
Upgrading to 0.3.24, 0.4.2 (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.24, 0.4.2. Upgrade your dependency to 0.3.24, 0.4.2 or later.
What CWE is associated with GHSA-8r5v-vm4m-4g25?
GHSA-8r5v-vm4m-4g25 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-8r5v-vm4m-4g25?
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-8r5v-vm4m-4g25",
  "modified" : "2024-01-19T15:24:56Z",
  "published" : "2024-01-19T15:24:56Z",
  "aliases" : [ ],
  "summary" : "Resource exhaustion vulnerability in h2 may lead to Denial of Service (DoS)",
  "details" : "An attacker with an HTTP/2 connection to an affected endpoint can send a steady stream of invalid frames to force the\ngeneration of reset frames on the victim endpoint.\nBy closing their recv window, the attacker could then force these resets to be queued in an unbounded fashion,\nresulting in Out Of Memory (OOM) and high CPU usage.\n\nThis fix is corrected in [hyperium/h2#737](https://github.com/hyperium/h2/pull/737), which limits the total number of\ninternal error resets emitted by default before the connection is closed.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "h2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.24"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "h2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.4.0"
      }, {
        "fixed" : "0.4.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/hyperium/h2/pull/737"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hyperium/h2/commit/59570e11ccddbec85f67a0c7aa353f7730c68854"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hyperium/h2/commit/d919cd6fd8e0f4f5d1f6282fab0b38a1b4bf999c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hyperium/h2"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0003.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-19T15:24:56Z",
    "nvd_published_at" : null
  }
}