CVE-2016-6581: Hpack Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-ffq8-576r-v26g
CVSS 7.5
Published
Advisory Summary

CVE-2016-6581 is a HIGH (CVSS 7.5) denial of service vulnerability (General Security Weakness) affecting Hpack libraries in the PyPI ecosystem. The issue involves hpack denial of service vulnerability (hpack bomb). Remediation is available by upgrading affected packages to version 2.3.0.

CVE-2016-6581 at a Glance

CVE Identifier CVE-2016-6581
GHSA Identifier GHSA-ffq8-576r-v26g
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification General Security Weakness
Affected Product Hpack
Package Ecosystem PyPI
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 CVE-2016-6581

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: 2.3.0
pip install hpack>=2.3.0
Verify Direct and Transitive Dependencies

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

pip show hpack

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2016-6581, inspect your installed packages using pip:

pip show 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 2.3.0), your application is affected.

Note: The pip show hpack command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. 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

A HTTP/2 implementation built using any version of the Python HPACK library between v1.0.0 and v2.2.0 could be targeted for a denial of service attack, specifically a so-called "HPACK Bomb" attack. This attack occurs when an attacker inserts a header field that is exactly the size of the HPACK dynamic header table into the dynamic header table. The attacker can then send a header block that is simply repeated requests to expand that field in the dynamic table. This can lead to a gigantic compression ratio of 4,096 or better, meaning that 16kB of data can decompress to 64MB of data on the target machine.

CVE-2016-6581 Affected Hpack Versions

1 component(s)
Fixed Versions:
2.3.0
Product / Package Ecosystem Affected Versions Fixed Version
hpack
PyPI
≥ 1.0.0
< 2.3.0
2.3.0

References

Frequently Asked Questions

What is CVE-2016-6581?
CVE-2016-6581 is a security vulnerability in Hpack involving HPACK Denial of Service vulnerability (HPACK Bomb) under General Security Weakness.
Which Hpack versions are affected?
Affected versions include releases prior to 2.3.0 across affected packages: hpack.
What version fixes CVE-2016-6581?
Upgrading to 2.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hpack affected?
Yes, hpack is affected in releases prior to 2.3.0. Upgrade your dependency to 2.3.0 or later.
What is the CVSS score of CVE-2016-6581?
CVE-2016-6581 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 CVE-2016-6581?
CVE-2016-6581 is classified under General Security Weakness.
How can I check PyPI dependencies for CVE-2016-6581?
Run the dependency tree command: 'pip show 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-ffq8-576r-v26g",
  "modified" : "2024-09-20T21:39:26Z",
  "published" : "2019-07-05T21:11:05Z",
  "aliases" : [ "CVE-2016-6581" ],
  "summary" : "HPACK Denial of Service vulnerability (HPACK Bomb)",
  "details" : "A HTTP/2 implementation built using any version of the Python HPACK library between v1.0.0 and v2.2.0 could be targeted for a denial of service attack, specifically a so-called \"HPACK Bomb\" attack. This attack occurs when an attacker inserts a header field that is exactly the size of the HPACK dynamic header table into the dynamic header table. The attacker can then send a header block that is simply repeated requests to expand that field in the dynamic table. This can lead to a gigantic compression ratio of 4,096 or better, meaning that 16kB of data can decompress to 64MB of data on the target machine.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "hpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "2.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-6581"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-ffq8-576r-v26g"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/hpack/PYSEC-2017-87.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/python-hyper/hpack"
  }, {
    "type" : "WEB",
    "url" : "https://python-hyper.org/hpack/en/latest/security/CVE-2016-6581.html"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200227233559/http://www.securityfocus.com/bid/92315"
  }, {
    "type" : "WEB",
    "url" : "http://python-hyper.org/projects/hpack/en/stable/security/CVE-2016-6581.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:34:33Z",
    "nvd_published_at" : null
  }
}