Feb 13, 2026·7 min read·129 visits
The Go HTML parser (`x/net/html`) contains a quadratic complexity bug in its tree construction logic. An attacker can send a malicious HTML payload (like deeply nested or malformed tags) that causes the parser to consume excessive CPU resources, effectively hanging the application. Fix: Upgrade `golang.org/x/net` to v0.45.0.
In the world of safe memory languages, we often forget that algorithmic complexity is a vulnerability class of its own. CVE-2025-47911 serves as a stark reminder: you don't need a buffer overflow to kill a server; you just need a really annoying HTML table. This vulnerability affects the `golang.org/x/net/html` package—the de facto standard for HTML parsing in the Go ecosystem—allowing attackers to trigger quadratic time complexity ($O(n^2)$) during the parsing of specially crafted inputs.
We've all been there. You need to parse some HTML. Maybe you're building a web crawler, a link preview generator, or an email sanitizer. You know better than to use Regex (because Zalgo comes), so you reach for the gold standard: golang.org/x/net/html. It's robust, it's maintained by the Go team, and it implements the HTML5 specification. What could go wrong?
Here is the thing about specifications: the HTML5 spec is a nightmare of backward compatibility and error recovery. It is designed to handle the absolute garbage markup that the internet produced in the 90s. This means the parser has to be smart. It has to fix your mistakes. It has to re-parent elements, close unclosed tags, and basically guess what the developer meant.
CVE-2025-47911 is what happens when that helpfulness turns toxic. By feeding the parser a specifically crafted sequence of garbage—think thousands of misaligned select or table tags—we can force the parser into a "panic mode" of sorts. It doesn't crash (panic) in the Go sense; instead, it enters a state of algorithmic despair, frantically walking up and down the element stack, consuming CPU cycles like they're free candy. It's a classic Algorithmic Complexity Denial of Service, and it turns your shiny Go microservice into a brick.
To understand this bug, you have to understand one of the most cursed parts of the HTML5 spec: the Adoption Agency Algorithm. This logic handles cases where formatting elements (like b, i, font) are closed in the wrong order or interrupted by block elements. For example, if you write <b><p>Text</b></p>, the browser (and the Go parser) has to figure out how to close the b tag before the p starts, or extend it into the p.
In the x/net/html implementation, the parser maintains a stack of open elements. When it encounters certain tags in specific states, it has to iterate through this stack to find a matching formatting element or to perform "fostering" of orphan elements (common in table parsing).
The vulnerability arises because the code failed to cap the number of iterations required for these stack fix-ups relative to the input size. If I send you an HTML document with 10,000 nested formatting elements interlaced with table elements, the parser might have to scan a significant portion of that 10,000-deep stack for every new tag I insert.
Mathematically, we are looking at $O(n^2)$ complexity. If $N=10,000$, $N^2 = 100,000,000$ operations. That transforms a 10KB payload processing time from milliseconds to seconds (or minutes), freezing the Goroutine responsible for the request.
The fix provided in CL 709876 is a textbook example of "defensive coding 101: always have an exit strategy." The original code would happily iterate through lists of active formatting elements without a hard stop, trusting that the stack wouldn't be maliciously deep. The patch introduces a constant overhead limit.
Here is a conceptual look at the vulnerable logic flow versus the patched logic:
// Vulnerable logic (simplified)
for {
// Walk up the stack looking for specific elements
// If the stack is 50,000 items deep, this loop runs 50,000 times
entry := findFormattingElement(stack)
if entry == nil {
break
}
// complex tree manipulation logic...
}The fix introduces a sanity check. It acknowledges that valid HTML shouldn't require thousands of stack adoption steps.
// Patched logic (simplified)
const maxIterations = 1000 // A sane limit
for i := 0; i < maxIterations; i++ {
entry := findFormattingElement(stack)
if entry == nil {
break
}
// complex tree manipulation logic...
}
if loopHitLimit {
// Stop trying to be smart. Just return or handle as error.
return
}By capping the loop, the complexity drops back towards linear $O(n)$. The parser might produce a slightly "wrong" tree for an insanely complex malicious input, but crucially, it finishes parsing.
Exploiting this doesn't require binary ninja skills; it requires a Python script and a bit of creativity. The goal is to maximize the work done by html.Parse per byte of input.
Target: A Markdown-to-HTML converter or a link preview service (e.g., Slack/Discord style previews) running on a vulnerable Go backend.
The most effective payloads typically involve abusing <table>, <select>, or <frameset> tags because they trigger specific complex modes in the parser state machine.
# PoC Generator for CVE-2025-47911
# Generates a payload that abuses the table adoption agency logic
payload = "<table>"
# Create a deep stack of formatting elements
for i in range(5000):
payload += "<b><i>"
# Trigger the parser to walk the stack repeatedly
for i in range(5000):
payload += "<p>Trigger Reconstruct</p>"
print(payload)When x/net/html parses this, every <p> tag inside that unclosed <table> forces the parser to reconcile the stack of 10,000 <b><i> tags.
> [!NOTE]
> Real-world impact depends on the server's timeout settings. However, since html.Parse is often called before any application-level timeouts (like context.WithTimeout) can interrupt the CPU-bound work, the Go runtime might not be able to schedule the cancellation effectively until a GC pause or function return.
You might look at the CVSS score of 5.3 and think, "Medium severity? I'll patch it next month." That would be a mistake. CVSS scores for DoS often fail to capture the operational reality of modern architecture.
In a Kubernetes environment, a single pod often handles concurrent requests. If you are running a single-threaded Node.js app, one request kills the server. Go handles concurrency better via Goroutines, but this bug is CPU-bound. If an attacker sends 4-8 concurrent requests (matching your CPU core count), they can peg the CPU at 100%.
The Domino Effect:
Affected systems include critical infrastructure pieces like Grafana, Helm, and Podman. If you use these tools to render user-supplied content, you are vulnerable.
The mitigation here is boring, which is good. You don't need to rewrite your architecture; you just need to bump a dependency.
Remediation Steps:
govulncheck ./...go get golang.org/x/net@v0.45.0
go mod tidyIf you cannot patch immediately (e.g., frozen codebase), you must implement strict input size limits before calling the parser. Truncating HTML input to a reasonable size (e.g., 50KB) can mitigate the worst of the $O(n^2)$ effects, turning a 10-second hang into a 100ms hiccup. However, truncation can break valid HTML, so patching is the only clean solution.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
golang.org/x/net Golang | < v0.45.0 | v0.45.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-400 (Uncontrolled Resource Consumption) |
| Attack Vector | Network |
| CVSS v3.1 | 5.3 (Medium) |
| Impact | Denial of Service (CPU Exhaustion) |
| Patch | golang.org/x/net v0.45.0 |
| Exploit Status | PoC Available (Trivial to construct) |
A denial-of-service vulnerability exists in the Go library github.com/insomniacslk/dhcp within the dhcpv4/nclient4 subpackage. In affected versions, the raw packet parsing function BroadcastRawUDPConn.ReadFrom subtracts the fixed 8-byte UDP header length from the IPv4 payload length declared in the packet header without first verifying that the declared payload length is at least 8 bytes. An unauthenticated attacker on an adjacent local network segment can broadcast or unicast a malformed IPv4 packet with a declared payload length between 0 and 7 bytes, causing a signed integer underflow that passes a negative slice bound into buf.Consume and triggers an unhandled Go runtime panic.
CVE-2026-63305 (GHSA-g9x9-q7qj-6mv5) is an operating system command injection vulnerability affecting WWBN AVideo (formerly YouPHPTube) versions up to and including 29.0. The defect resides in the standalone FFmpeg execution handler at plugin/API/standAlone/ffmpeg.json.php. When assembling asynchronous post-processing commands, the script concatenates the notifyCode and callback properties from a decrypted payload directly into a shell command string without sanitization. An attacker capable of providing or forging a valid encrypted execution payload can inject shell metacharacters to achieve remote code execution under the privileges of the web server user.
The cakephp/twig-view plugin integrates the Twig templating engine into the CakePHP framework. Prior to versions 1.3.3 and 2.1.2, the UtilsExtension class exposes PHP's native unserialize() function as a Twig filter without restricting allowed classes. When untrusted data is passed into the unserialize filter within a template, an attacker can trigger PHP Object Injection and execute Property-Oriented Programming (POP) gadget chains, leading to arbitrary code execution or data manipulation.
CVE-2026-63402 is a prototype-chain traversal and shared built-in object corruption vulnerability in the i18next internationalization framework for JavaScript prior to version 26.3.4. The flaw resides in the deepExtend utility function within src/utils.js, which uses the JavaScript 'in' operator to verify property existence on target objects. When an application passes untrusted resource bundles to i18next.addResourceBundle() with both the deep and overwrite parameters set to true, an attacker can traverse into inherited methods on Object.prototype and overwrite properties on shared built-in function objects, causing process-wide denial of service.
CVE-2026-58262 (tracked internally as KLR-04 and via GitHub Security Advisory GHSA-f9h7-4mmq-vgcq) is a cryptographic verification and consensus quorum bypass vulnerability in Klever-Go (`klever-io/klever-go`), the Go implementation of the Klever blockchain protocol. Prior to version 1.7.20, the block header signature verification logic (`HeaderSigVerifier.verifyConsensusSize`) counts all set bits across the entire `PubKeysBitmap` byte slice toward the required two-thirds validator quorum without masking or validating unused trailing padding bits in the final byte. Because the underlying Boneh-Lynn-Shacham (BLS) multi-signature verification function (`blsMultiSigner.Verify`) iterates strictly over the indices of configured validator public keys, it ignores any bits set at indices beyond the active consensus group size. When the consensus group size is not an exact multiple of 8, a compromised or malicious block producer can set these unused trailing padding bits to artificially inflate the apparent signer count by up to 7 signatures, enabling blocks with fewer genuine validator signatures than required by the protocol to pass consensus validation.
CVE-2026-77423 is a Regular Expression Denial of Service (ReDoS) vulnerability in the built-in less viewer of the JLine Java library (versions 3.0.0 prior to 3.30.15, and 4.0.0 prior to 4.3.1). The org.jline.builtins.Less class passes user-supplied search and display-filter patterns directly to Java's standard backtracking regular expression engine without complexity validation or execution timeouts. An attacker with access to an interactive JLine session can submit patterns containing nested quantifiers, causing catastrophic backtracking that consumes 100% of a CPU core and blocks the session thread indefinitely. In network-facing deployments such as SSH or Telnet administration consoles, repeated exploitation across concurrent sessions can exhaust bounded worker thread pools and result in a complete denial of service.