Quadratic parsing complexity in golang.org/x/net/html
Description
The html.Parse function in golang.org/x/net/html has quadratic parsing complexity when processing certain inputs, which can lead to denial of service (DoS) if an attacker provides specially crafted HTML content.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
The html.Parse function in golang.org/x/net/html has quadratic parsing complexity leading to denial of service via crafted HTML.
Vulnerability
Analysis
The html.Parse function in the golang.org/x/net/html package exhibits quadratic parsing complexity when handling certain inputs [1]. This means the processing time can grow disproportionately compared to the input size, potentially causing slow execution or denial of service [1][4]. The root cause lies in the HTML specification's algorithms, which inherently contain quadratic complexity aspects [4].
Exploitation and
Impact
An attacker can exploit this by providing a specially crafted HTML document to an application that parses untrusted HTML content [4]. The parser's processing time will scale non-linearly with input size, leading to excessive resource consumption and eventual denial of service [1][4]. No authentication is required if the application accepts external input, making this exploitable across network boundaries where HTML parsing occurs.
Mitigation
The vulnerability is patched in version v0.45.0 of golang.org/x/net [4]. The fix imposes a depth limit of 512 on nested HTML tags, which should be sufficient for most valid documents [4]. Affected programs should update to the patched version to mitigate the DoS risk. There is no evidence that this vulnerability is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog at the time of publication.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
golang.org/x/net/htmlGo | < 0.45.0 | 0.45.0 |
Affected products
2- golang.org/x/net/golang.org/x/net/htmlv5Range: 0
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
7- github.com/advisories/GHSA-w4gw-w5jq-g9jhghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-47911ghsaADVISORY
- github.com/golang/vulndb/issues/4440ghsaWEB
- go.dev/cl/709876ghsaWEB
- go.googlesource.com/netghsaPACKAGE
- groups.google.com/g/golang-announce/c/jnQcOYpiR2cghsaWEB
- pkg.go.dev/vuln/GO-2026-4440ghsaWEB
News mentions
0No linked articles in our index yet.