CVE-2026-78661: 
Gitea vulnerability analysis and mitigation

Overview

CVE-2026-78661 is a Denial of Service vulnerability in the golang.org/x/net/html HTML parser caused by inefficient algorithmic complexity (CWE-407) during text node coalescing. When adjacent text nodes are merged in the addText and fosterParent functions, string concatenation (n.Data += text) triggers a full reallocation and copy of the accumulated string on every token, resulting in O(n²) memory allocations and byte copies for inputs with many short text runs separated by ignored end tags (e.g., a</x>). All versions of golang.org/x/net/html before 0.62.0 are affected. The vulnerability was published on October 27, 2026, with a patch released the same day. The CVSS base score is estimated as Medium; the EUVD-assigned base score is 0.0 (pending full NVD analysis) (GitHub Advisory, OSV).

Technical details

The root cause is inefficient string concatenation in the Go HTML parser's addText and fosterParent functions, classified as CWE-407 (Inefficient Algorithmic Complexity). Each time a text token is appended to an existing TextNode, the expression n.Data += text causes Go's runtime to allocate a new string and copy all previously accumulated bytes, yielding O(n²) total work for n tokens. The fix accumulates coalesced text in per-node byte slices during parsing and materializes the final Data string only once at the end of the parse, reducing complexity to O(n). The issue is tracked upstream at go.dev/issue/82224 and the code change is at go.dev/cl/849365. No preconditions beyond the ability to supply HTML input to a service using the affected parser are required (GitHub Advisory, OSV).

Impact

Successful exploitation causes excessive memory allocations and CPU consumption in any service that parses attacker-controlled HTML using golang.org/x/net/html versions before 0.62.0, potentially degrading or crashing the HTML parsing service. The impact is limited to availability (Denial of Service); there is no evidence of confidentiality or integrity compromise. Services that accept arbitrary HTML input from unauthenticated users are at highest risk (GitHub Advisory, OSV).

Exploitability

There is no known public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the disclosure date. The vulnerability is unauthenticated and requires only the ability to send crafted HTML input to an affected service. The EPSS score is 0.0, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. No threat actor attribution has been reported (GitHub Advisory, OSV).

Exploitation steps

  1. Identify target: Locate a service that accepts HTML input and processes it using golang.org/x/net/html at a version below 0.62.0 (e.g., a web scraper, HTML sanitizer, or content rendering service built in Go).
  2. Craft malicious payload: Construct an HTML document containing a large number of short text runs separated by ignored end tags, such as a repeated pattern of a</x>b</x>c</x>... with thousands of iterations.
  3. Submit payload: Send the crafted HTML to the target service's input endpoint (e.g., via HTTP POST to an HTML processing API or form submission).
  4. Trigger O(n²) behavior: The parser's addText/fosterParent functions repeatedly reallocate and copy the accumulated string for each token, causing exponential growth in memory usage and CPU time.
  5. Achieve DoS: The service exhausts available memory or CPU, resulting in degraded performance or a crash (GitHub Advisory, OSV).

Indicators of compromise

  • Network: Unusually large or repetitive HTML payloads submitted to HTML-processing endpoints; high-frequency requests with structurally similar malformed HTML content.
  • Process: Go service processes exhibiting sudden spikes in CPU and memory consumption correlated with HTML parsing operations; out-of-memory (OOM) kills of Go-based services.
  • Logs: Application logs showing parsing timeouts or panics in golang.org/x/net/html; repeated errors or slow response times on endpoints that accept HTML input.

Mitigation and workarounds

Upgrade golang.org/x/net/html to version 0.62.0 or later, which accumulates coalesced text in per-node byte slices and materializes strings only once at parse completion, eliminating the O(n²) behavior. As interim mitigations, implement input size limits and request timeouts on HTML parsing operations, and apply rate limiting to endpoints that accept HTML input. Rebuilding and redeploying any Go application that vendors or depends on golang.org/x/net is required to pick up the fix (GitHub Advisory, Go CL 849365).

Community reactions

The vulnerability was announced via the golang-announce mailing list and noted on infosec.exchange and oss-sec. Community reaction has been low-key, consistent with a moderate-severity DoS in a widely used Go library with a straightforward patch and no active exploitation. No major vendor statements or notable researcher commentary beyond the standard Go security disclosure process have been observed (golang-announce, oss-sec).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

golang-golang-x-net

Affected

sid

golang-golang-x-net

Affected

trixie

golang-golang-x-net

Affected

Ubuntu

Unknown

bionic (esm-apps)

google-guest-agent

Unknown

bionic (esm-infra)

lxd

Unknown

devel

golang-golang-x-net

Unknown

focal (esm-apps)

google-osconfig-agent

Unknown

focal (esm-infra)

google-guest-agent

Unknown

jammy

golang-golang-x-net

Unknown

jammy (esm-apps)

golang-golang-x-net

Unknown

noble

golang-golang-x-net

Unknown

Source: This report was generated using AI

Related Gitea vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-97859MEDIUM6.5
  • Gitea logoGitea
  • gitea
NoNoOct 18, 2026
CVE-2026-114437MEDIUM6.3
  • Datadog Agent logoDatadog Agent
  • llm-d-router-fips
NoYesOct 21, 2026
CVE-2026-97204LOW3.1
  • Gitea logoGitea
  • gitea
NoNoOct 18, 2026
CVE-2026-97045NONEN/A
  • Gitea logoGitea
  • hugo-fips
NoYesOct 27, 2026
CVE-2026-78661NONEN/A
  • Gitea logoGitea
  • golang-1.21
NoYesOct 27, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management