Vulnerabilities in pkg:golang/golang.org/x/net/http2

PACKAGE
Advisory Identifier: GHSA-4v7x-pqxf-cx7m
Advisory Summary

CVE-2023-45288 is a MODERATE (CVSS 5.3) close connections when receiving too vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting net/http, x/net/http2 libraries in the Go ecosystem. The issue involves close connections when receiving too many headers. Remediation is available by upgrading affected packages to version 1.21.9, 0.23.0, 1.22.2.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/golang.org/x/net/http2

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/golang.org/x/net/http2. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-4v7x-pqxf-cx7m CVE-2023-45288 MODERATE net/http, x/net/http2: close connections when receiving too many headers
GHSA-xrjj-mj9h-534m CVE-2022-41717 MODERATE golang.org/x/net/http2 vulnerable to possible excessive memory growth
GHSA-69cg-p879-7622 CVE-2022-27664 HIGH golang.org/x/net/http2 Denial of Service vulnerability
GHSA-vc3p-29h2-gpcp CVE-2021-44716 HIGH golang.org/x/net/http2 allows uncontrolled memory consumption

CVE-2023-45288 at a Glance

CVE Identifier CVE-2023-45288
GHSA Identifier GHSA-4v7x-pqxf-cx7m
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product net/http, x/net/http2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:L).

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 Low (A:L)

How to Fix CVE-2023-45288

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

net/http fixed: 1.21.9
Upgrade net/http to 1.21.9
golang.org/x/net/http2 fixed: 0.23.0
Upgrade golang.org/x/net/http2 to 0.23.0
net/http fixed: 1.22.2
Upgrade net/http to 1.22.2
golang.org/x/net fixed: 0.23.0
Upgrade golang.org/x/net to 0.23.0
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 net/http

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-45288, inspect your project dependencies for net/http, x/net/http2:

inspect dependencies for net/http

Analyze the terminal output to locate any version of net/http, x/net/http2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.21.9), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In net/http, x/net/http2, 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 may cause an HTTP/2 endpoint to read arbitrary amounts of header data by sending an excessive number of CONTINUATION frames. Maintaining HPACK state requires parsing and processing all HEADERS and CONTINUATION frames on a connection. When a request's headers exceed MaxHeaderBytes, no memory is allocated to store the excess headers, but they are still parsed. This permits an attacker to cause an HTTP/2 endpoint to read arbitrary amounts of header data, all associated with a request which is going to be rejected. These headers can include Huffman-encoded data which is significantly more expensive for the receiver to decode than for an attacker to send. The fix sets a limit on the amount of excess header frames we will process before closing a connection.

CVE-2023-45288 Affected net/http, x/net/http2 Versions

4 component(s)
Fixed Versions:
1.21.90.23.01.22.2
Product / Package Ecosystem Affected Versions Fixed Version
net/http
Go
< 1.21.9
1.21.9
golang.org/x/net/http2
Go
< 0.23.0
0.23.0
net/http
Go
≥ 1.22.0-0
< 1.22.2
1.22.2
golang.org/x/net
Go
< 0.23.0
0.23.0

References

Frequently Asked Questions

What is CVE-2023-45288?
CVE-2023-45288 is a security vulnerability in net/http, x/net/http2 involving close connections when receiving too many headers under CWE-400: Uncontrolled Resource Consumption.
Which net/http, x/net/http2 versions are affected?
Affected versions include releases prior to 1.21.9, 0.23.0, 1.22.2 across affected packages: net/http, golang.org/x/net/http2, golang.org/x/net.
What version fixes CVE-2023-45288?
Upgrading to 1.21.9, 0.23.0, 1.22.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is net/http affected?
Yes, net/http is affected in releases prior to 1.21.9, 1.22.2. Upgrade your dependency to 1.21.9, 1.22.2 or later.
Is golang.org/x/net/http2 affected?
Yes, golang.org/x/net/http2 is affected in releases prior to 0.23.0. Upgrade your dependency to 0.23.0 or later.
What is the CVSS score of CVE-2023-45288?
CVE-2023-45288 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2023-45288?
CVE-2023-45288 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Go dependencies for CVE-2023-45288?
Run the dependency tree command: 'inspect dependencies for net/http'. 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-4v7x-pqxf-cx7m",
  "modified" : "2025-11-04T22:15:09Z",
  "published" : "2024-04-04T21:30:32Z",
  "aliases" : [ "CVE-2023-45288" ],
  "summary" : "net/http, x/net/http2: close connections when receiving too many headers",
  "details" : "An attacker may cause an HTTP/2 endpoint to read arbitrary amounts of header data by sending an excessive number of CONTINUATION frames. Maintaining HPACK state requires parsing and processing all HEADERS and CONTINUATION frames on a connection. When a request's headers exceed MaxHeaderBytes, no memory is allocated to store the excess headers, but they are still parsed. This permits an attacker to cause an HTTP/2 endpoint to read arbitrary amounts of header data, all associated with a request which is going to be rejected. These headers can include Huffman-encoded data which is significantly more expensive for the receiver to decode than for an attacker to send. The fix sets a limit on the amount of excess header frames we will process before closing a connection.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "net/http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.21.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "golang.org/x/net/http2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.23.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "net/http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.22.0-0"
      }, {
        "fixed" : "1.22.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "golang.org/x/net"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.23.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-45288"
  }, {
    "type" : "WEB",
    "url" : "https://go.dev/cl/576155"
  }, {
    "type" : "WEB",
    "url" : "https://go.dev/issue/65051"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/golang-announce/c/YgW0sx8mN3M"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QRYFHIQ6XRKRYBI2F5UESH67BJBQXUPT"
  }, {
    "type" : "WEB",
    "url" : "https://nowotarski.info/http2-continuation-flood-technical-details"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-2687"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240419-0009"
  }, {
    "type" : "WEB",
    "url" : "https://www.kb.cert.org/vuls/id/421644"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2024/04/03/16"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2024/04/05/4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-04T23:02:57Z",
    "nvd_published_at" : "2024-04-04T21:15:16Z"
  }
}