GHSA-w8gf-g2vq-j2f4: Amphp/http client Denial of Service Vulnerability

HIGH
CVSS 8.2
CWE-789 CWE-770
Published
Advisory Summary

GHSA-w8gf-g2vq-j2f4 is a HIGH (CVSS 8.2) denial of service vulnerability (CWE-789: Memory Allocation with Excessive Size Value) affecting Amphp/http client libraries in the Packagist ecosystem. The issue involves amphp/http-client denial of service via http/2 continuation frames. Remediation is available by upgrading affected packages to version 4.1.0-rc1.

GHSA-w8gf-g2vq-j2f4 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-w8gf-g2vq-j2f4
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-789: Memory Allocation with Excessive Size Value
Affected Product Amphp/http client
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.2

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:L/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 Low (I:L)
Availability High (A:H)

How to Fix GHSA-w8gf-g2vq-j2f4

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

amphp/http-client fixed: 4.1.0-rc1
Upgrade amphp/http-client to 4.1.0-rc1
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 amphp/http-client

How to Check if You Are Affected

To determine whether your application is affected by GHSA-w8gf-g2vq-j2f4, inspect your project dependencies for Amphp/http client:

inspect dependencies for amphp/http-client

Analyze the terminal output to locate any version of Amphp/http client in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.0-rc1), 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-789: Memory Allocation with Excessive Size Value, where the product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated. In Amphp/http client, 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

Early versions of `amphp/http-client` with HTTP/2 support (v4.0.0-rc10 to 4.0.0) will collect HTTP/2 `CONTINUATION` frames in an unbounded buffer and will not check the header size limit until it has received the `END_HEADERS` flag, resulting in an OOM crash. Later versions of `amphp/http-client` (v4.1.0-rc1 and up) depend on `amphp/http` for HTTP/2 processing and will therefore need an updated version of `amphp/http`, see [GHSA-qjfw-cvjf-f4fm](https://github.com/amphp/http/security/advisories/GHSA-qjfw-cvjf-f4fm). ## Acknowledgements Thank you to [Bartek Nowotarski](https://nowotarski.info/) for reporting the vulnerability.

GHSA-w8gf-g2vq-j2f4 Affected Amphp/http client Versions

1 component(s)
Fixed Versions:
4.1.0-rc1
Product / Package Ecosystem Affected Versions Fixed Version
amphp/http-client
Packagist
≥ 4.0.0-rc10
< 4.1.0-rc1
4.1.0-rc1

References

Frequently Asked Questions

What is GHSA-w8gf-g2vq-j2f4?
GHSA-w8gf-g2vq-j2f4 is a security vulnerability in Amphp/http client involving amphp/http-client Denial of Service via HTTP/2 CONTINUATION Frames under CWE-789: Memory Allocation with Excessive Size Value.
Which Amphp/http client versions are affected?
Affected versions include releases prior to 4.1.0-rc1 across affected packages: amphp/http-client.
What version fixes GHSA-w8gf-g2vq-j2f4?
Upgrading to 4.1.0-rc1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is amphp/http-client affected?
Yes, amphp/http-client is affected in releases prior to 4.1.0-rc1. Upgrade your dependency to 4.1.0-rc1 or later.
What is the CVSS score of GHSA-w8gf-g2vq-j2f4?
GHSA-w8gf-g2vq-j2f4 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H.
What CWE is associated with GHSA-w8gf-g2vq-j2f4?
GHSA-w8gf-g2vq-j2f4 is classified under CWE-789: Memory Allocation with Excessive Size Value (The product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated.).
How can I check Packagist dependencies for GHSA-w8gf-g2vq-j2f4?
Run the dependency tree command: 'inspect dependencies for amphp/http-client'. 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-w8gf-g2vq-j2f4",
  "modified" : "2024-04-03T18:49:42Z",
  "published" : "2024-04-03T18:49:42Z",
  "aliases" : [ ],
  "summary" : "amphp/http-client  Denial of Service via HTTP/2 CONTINUATION Frames",
  "details" : "Early versions of `amphp/http-client` with HTTP/2 support (v4.0.0-rc10 to 4.0.0) will collect HTTP/2 `CONTINUATION` frames in an unbounded buffer and will not check the header size limit until it has received the `END_HEADERS` flag, resulting in an OOM crash. Later versions of `amphp/http-client` (v4.1.0-rc1 and up) depend on `amphp/http` for HTTP/2 processing and will therefore need an updated version of `amphp/http`, see [GHSA-qjfw-cvjf-f4fm](https://github.com/amphp/http/security/advisories/GHSA-qjfw-cvjf-f4fm).\n\n## Acknowledgements\n\nThank you to [Bartek Nowotarski](https://nowotarski.info/) for reporting the vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "amphp/http-client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0-rc10"
      }, {
        "fixed" : "4.1.0-rc1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.0.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/amphp/http-client/security/advisories/GHSA-w8gf-g2vq-j2f4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/amphp/http/security/advisories/GHSA-qjfw-cvjf-f4fm"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/amphp/http-client"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770", "CWE-789" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-03T18:49:42Z",
    "nvd_published_at" : null
  }
}