CVE-2024-45338: Golang.org/x/net/html Non-linear Parsing Of Case-insensitive Content Vulnerability

HIGH
Advisory Identifier: GHSA-w32m-9786-jp63
CWE-770
Published
Advisory Summary

CVE-2024-45338 is a HIGH non-linear parsing of case-insensitive content vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Golang.org/x/net/html libraries in the Go ecosystem. The issue involves non-linear parsing of case-insensitive content in golang.org/x/net/html. Remediation is available by upgrading affected packages to version 0.33.0.

CVE-2024-45338 at a Glance

CVE Identifier CVE-2024-45338
GHSA Identifier GHSA-w32m-9786-jp63
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Golang.org/x/net/html
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2024-45338

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

golang.org/x/net/html fixed: 0.33.0
Upgrade golang.org/x/net/html to 0.33.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 golang.org/x/net/html

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-45338, inspect your project dependencies for Golang.org/x/net/html:

inspect dependencies for golang.org/x/net/html

Analyze the terminal output to locate any version of Golang.org/x/net/html in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.33.0), 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Golang.org/x/net/html, 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 can craft an input to the Parse functions that would be processed non-linearly with respect to its length, resulting in extremely slow parsing. This could cause a denial of service.

CVE-2024-45338 Affected Golang.org/x/net/html Versions

1 component(s)
Fixed Versions:
0.33.0
Product / Package Ecosystem Affected Versions Fixed Version
golang.org/x/net/html
Go
< 0.33.0
0.33.0

References

Frequently Asked Questions

What is CVE-2024-45338?
CVE-2024-45338 is a security vulnerability in Golang.org/x/net/html involving Non-linear parsing of case-insensitive content in golang.org/x/net/html under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Golang.org/x/net/html versions are affected?
Affected versions include releases prior to 0.33.0 across affected packages: golang.org/x/net/html.
What version fixes CVE-2024-45338?
Upgrading to 0.33.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is golang.org/x/net/html affected?
Yes, golang.org/x/net/html is affected in releases prior to 0.33.0. Upgrade your dependency to 0.33.0 or later.
What CWE is associated with CVE-2024-45338?
CVE-2024-45338 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check Go dependencies for CVE-2024-45338?
Run the dependency tree command: 'inspect dependencies for golang.org/x/net/html'. 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-w32m-9786-jp63",
  "modified" : "2025-03-16T17:24:07Z",
  "published" : "2024-12-18T21:59:48Z",
  "aliases" : [ "CVE-2024-45338" ],
  "summary" : "Non-linear parsing of case-insensitive content in golang.org/x/net/html",
  "details" : "An attacker can craft an input to the Parse functions that would be processed non-linearly with respect to its length, resulting in extremely slow parsing. This could cause a denial of service.",
  "severity" : [ {
    "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" : "Go",
      "name" : "golang.org/x/net/html"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.33.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-45338"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/golang/go/issues/70906"
  }, {
    "type" : "PACKAGE",
    "url" : "https://cs.opensource.google/go/x/net"
  }, {
    "type" : "WEB",
    "url" : "https://go.dev/cl/637536"
  }, {
    "type" : "WEB",
    "url" : "https://go.dev/issue/70906"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/golang-announce/c/wSCRmFnNmPA/m/Lvcd0mRMAwAJ"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3333"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-18T21:59:48Z",
    "nvd_published_at" : "2024-12-18T21:15:08Z"
  }
}