GHSA-w7hm-hmxv-pvhf: Hpack HPACK Decoder Panics On Invalid Vulnerability

HIGH
CVSS 7.5
CWE-754
Published
Advisory Summary

GHSA-w7hm-hmxv-pvhf is a HIGH (CVSS 7.5) hpack decoder panics on invalid vulnerability (CWE-754: Improper Check for Unusual or Exceptional Conditions) affecting Hpack libraries in the crates.io ecosystem. The issue involves hpack decoder panics on invalid input. Remediation is available in the latest vendor maintenance releases.

GHSA-w7hm-hmxv-pvhf at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-w7hm-hmxv-pvhf
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-754: Improper Check for Unusual or Exceptional Conditions
Affected Product Hpack
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix GHSA-w7hm-hmxv-pvhf

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

hpack fixed: Latest secure release
Upgrade hpack to Latest secure release
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 hpack

How to Check if You Are Affected

To determine whether your application is affected by GHSA-w7hm-hmxv-pvhf, inspect your project dependencies for Hpack:

inspect dependencies for hpack

Analyze the terminal output to locate any version of Hpack in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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-754: Improper Check for Unusual or Exceptional Conditions, where the product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product. In Hpack, 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

Due to insufficient checking of input data, decoding certain data sequences can lead to _Decoder::decode_ panicking rather than returning an error. Example code that triggers this vulnerability looks like this: ```rust use hpack::Decoder; pub fn main() { let input = &[0x3f]; let mut decoder = Decoder::new(); let _ = decoder.decode(input); } ``` hpack is unmaintained. A crate with the panics fixed has been published as [hpack-patched](https://crates.io/crates/hpack-patched). Also consider using [fluke-hpack](https://crates.io/crates/fluke-hpack) or [httlib-huffman](https://crates.io/crates/httlib-huffman) as an alternative.

GHSA-w7hm-hmxv-pvhf Affected Hpack Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
hpack
crates.io
≤ 0.3.0

References

Frequently Asked Questions

What is GHSA-w7hm-hmxv-pvhf?
GHSA-w7hm-hmxv-pvhf is a security vulnerability in Hpack involving HPACK decoder panics on invalid input under CWE-754: Improper Check for Unusual or Exceptional Conditions.
Which Hpack versions are affected?
Affected versions include releases prior to current release patches across affected packages: hpack.
What version fixes GHSA-w7hm-hmxv-pvhf?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is hpack affected?
Yes, hpack is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of GHSA-w7hm-hmxv-pvhf?
GHSA-w7hm-hmxv-pvhf has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with GHSA-w7hm-hmxv-pvhf?
GHSA-w7hm-hmxv-pvhf is classified under CWE-754: Improper Check for Unusual or Exceptional Conditions (The product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product.).
How can I check crates.io dependencies for GHSA-w7hm-hmxv-pvhf?
Run the dependency tree command: 'inspect dependencies for hpack'. 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-w7hm-hmxv-pvhf",
  "modified" : "2024-04-05T15:06:27Z",
  "published" : "2024-04-05T15:06:27Z",
  "aliases" : [ ],
  "summary" : "HPACK decoder panics on invalid input",
  "details" : "Due to insufficient checking of input data, decoding certain data sequences can lead to _Decoder::decode_ panicking rather than returning an error.\n\nExample code that triggers this vulnerability looks like this:\n\n```rust\nuse hpack::Decoder;\n\npub fn main() {\n  let input = &[0x3f];\n  let mut decoder = Decoder::new();\n  let _ = decoder.decode(input);\n}\n```\n\nhpack is unmaintained. A crate with the panics fixed has been published as [hpack-patched](https://crates.io/crates/hpack-patched).\n\nAlso consider using [fluke-hpack](https://crates.io/crates/fluke-hpack) or [httlib-huffman](https://crates.io/crates/httlib-huffman) as an alternative.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "hpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mlalic/hpack-rs/issues/11"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sno2/hpack-rs-patched/commit/d669282924a95311599e9e7dd53869ee96b3a2f5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mlalic/hpack-rs"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0085.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-754" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-05T15:06:27Z",
    "nvd_published_at" : null
  }
}