Feb 12, 2026·6 min read·157 visits
A 2MB XML file can cause libexpat to consume 25-100 seconds of CPU time due to inefficient algorithmic complexity (O(n^2)). Affects all versions through 2.7.3. Currently unfixed.
In the world of foundational software, few libraries are as load-bearing as libexpat. From Python to Apache, it parses the XML that powers the internet. CVE-2025-66382 exposes a nasty algorithmic complexity flaw in this ubiquitous library, where a specifically crafted 2MB file can lock up a CPU for nearly two minutes. As of early 2026, this vulnerability remains unfixed, leaving a massive surface area exposed to Denial of Service attacks.
If you are reading this, you are almost certainly running code that depends on libexpat. It is the parsing engine under the hood of Python's xml.etree, PHP's XML extensions, the Apache HTTP server, Mozilla Firefox, and roughly a billion embedded devices. It is the definition of "critical infrastructure" in the open-source world.
Usually, when we talk about libexpat vulnerabilities, we are terrified of Remote Code Execution (RCE) via heap overflows. But CVE-2025-66382 is a different beast. It is not about corrupting memory; it is about wasting time. Specifically, your CPU's time.
Imagine a bouncer at a club who checks IDs. Normally, it takes 5 seconds per person. This vulnerability is like handing the bouncer an ID printed on a Mobius strip. He doesn't crash, he doesn't die, he just stands there staring at it for two minutes while the line outside (your network traffic) grows infinitely long. The scariest part? As of early 2026, the bouncer still hasn't figured out how to stop staring.
The vulnerability falls under CWE-407: Inefficient Algorithmic Complexity. In plain English, this means the developers implemented a feature where the processing time grows disproportionately to the input size.
Most parsing operations should be linear, or $O(n)$. You read a byte, you process a byte. If you double the file size, you double the processing time. However, somewhere deep in libexpat's logic—likely involving attribute normalization, namespace resolution, or entity tracking—there is a loop that behaves quadratically, $O(n^2)$, or perhaps even worse.
Here is the math of the nightmare:
That is an eternity in CPU time. If an attacker sends just one of these files per second, they can permanently pin 25-100 CPU cores at 100% utilization. This isn't a "crash"; the process is technically "working correctly," just agonizingly slowly. This makes it incredibly hard for standard watchdogs to detect, as the service hasn't segfaulted—it's just effectively dead.
Usually, this is the part where I show you the diff—the specific lines of C code where the developer forgot a bounds check or messed up a pointer. But I can't do that here. Why? Because there is no fix yet.
Maintainer Sebastian Pipping confirmed the issue affects all releases of libexpat. The complexity of the fix is high enough that, despite being reported in September 2025, the library remains vulnerable in February 2026. However, we can simulate the concept of the flaw.
Imagine a naive implementation of attribute uniqueness checking:
// CONCEPTUAL EXAMPLE OF O(n^2) FAILURE
// This is NOT the actual libexpat code, but illustrates the flaw.
void check_attribute_uniqueness(Attribute *attrs, int count) {
for (int i = 0; i < count; i++) {
for (int j = i + 1; j < count; j++) {
// If we have 10,000 attributes, this inner loop runs
// roughly 50,000,000 times.
if (strcmp(attrs[i].name, attrs[j].name) == 0) {
report_error("Duplicate attribute");
}
}
}
}In the code above, if an attacker provides an XML tag with 50,000 attributes, the CPU has to perform billions of string comparisons. Modern parsers usually use hash maps to achieve $O(n)$ or $O(n \log n)$ performance.
The actual flaw in libexpat is subtle. It involves a specific, non-public trigger file that hits a "sweet spot" in the parser's state machine, forcing it into a similarly expensive computational hole. The fact that the maintainer described the fix as "not as complex as resolving recursion" but still non-trivial suggests it requires architectural changes to how state is tracked, rather than a simple one-line patch.
Since the specific trigger file is currently under a "freeform NDA" between the researcher and the maintainer, there is no public PoC on GitHub. However, an attacker doesn't need the exact file to understand the attack surface. They just need to fuzz the parser's complexity limits.
client_max_body_size).If the server is multi-threaded (like Apache Prefork), the attacker only needs to send enough requests to fill the MaxRequestWorkers pool. Once the pool is full of "zombie" workers crunching this 2MB file, the server stops responding to legitimate traffic.
This is the uncomfortable part. There is no apt-get upgrade to save you right now. The vulnerability is "Unfixed" upstream. So, how do you stop your servers from melting?
If you can't fix the parser, you must kill the parser. Implement strict timeouts at the application level. No XML parsing operation for a standard web request should take more than 1 or 2 seconds.
signal based timeouts or wrap parsing in a thread with a .join(timeout=2.0).Timeout directives, though this is a blunt instrument that might kill legitimate long requests.The trigger is ~2 MiB. While valid XML can be larger, most transactional XML (SOAP/SAML) is much smaller (under 50KB).
> [!WARNING]
> Hard Limit Strategy: Configure your WAF or reverse proxy (Nginx/HAProxy) to reject XML bodies larger than 1MB unless you strictly require them. This kills the known trigger before it reaches libexpat.
Set up alerts for CPU Steal or high User CPU usage on your web nodes. If you see a plateau of 100% usage without a corresponding spike in traffic throughput (RPS), you are likely under an algorithmic complexity attack.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
libexpat libexpat project | <= 2.7.3 | None (Anticipated in 2.7.4) |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-407 (Inefficient Algorithmic Complexity) |
| Attack Vector | Local / Remote (Context Dependent) |
| CVSS v3.1 | 6.2 (Medium) |
| Impact | Denial of Service (CPU Exhaustion) |
| Trigger Size | ~2 MiB |
| Exploit Status | Proof of Concept Exists (Private) |
The product handles input in a way that produces an algorithmic complexity that is significantly worse than the optimal complexity, allowing an attacker to cause a Denial of Service.
CVE-2026-115895 is a high-severity code injection vulnerability (CWE-94) in the happy-dom npm package prior to version 21.0.4. The vulnerability exists within the ECMAScriptModuleCompiler component, which transforms ECMAScript module syntax into executable Node.js functions when JavaScript evaluation is enabled. Due to an incomplete fix for CVE-2026-33943, the compiler failed to validate local named import aliases against legal JavaScript identifier rules. Attackers supplying crafted module imports—specifically utilizing destructuring default initializers alongside JSON module attributes—can inject arbitrary JavaScript expressions directly into the host Node.js runtime context.
An improper input validation and authorization bypass vulnerability exists in the LangGraph storage layer affecting langgraph, langgraph-checkpoint-postgres, and langgraph-checkpoint-sqlite. Because relational store implementations serialize namespace tuples into dot-delimited strings without validating labels on read, search, delete, and batch operations, an attacker who controls a namespace label can inject periods (.) to traverse namespace boundaries and access, modify, or delete data belonging to other namespaces.
CVE-2026-115886 (GHSA-2wqp-q3c6-ccj5) is a Server-Side Request Forgery (SSRF) and Unsafe Reflection vulnerability in MLflow versions 3.12.0rc0 prior to 3.17.0. Unauthenticated REST API endpoints accept serialized third-party scorer JSON payloads that are dynamically deserialized and reflectively instantiated without sanitizing constructor keyword arguments. When optional dependencies such as trulens and trulens-providers-litellm are installed, attackers can inject egress-steering arguments into the scorer payload, forcing the MLflow server to dispatch outbound HTTP requests to arbitrary internal destinations or cloud metadata services.
CVE-2026-113872 (GHSA-q7qp-rjg7-q26m) is a high-severity denial-of-service vulnerability affecting the multer multipart/form-data upload middleware for Node.js and Express in versions 2.0.0 through 2.4.0. When an endpoint is configured to accept multiple files using an asynchronous fileFilter callback, a crafted, truncated multipart HTTP request can trigger an unhandled error event on the underlying busboy stream parser after request teardown has already completed. Because all error listeners are stripped during teardown, Node.js treats the resulting error event as an uncaught exception and immediately terminates the server process.
CVE-2026-115897 (also tracked as GHSA-m5mm-p8h7-m29v and aliased as CVE-2026-115754) is a Cross-Site Scripting (XSS) vulnerability in the Yahoo serialize-javascript npm package prior to version 7.1.3. The flaw exists in the regular expression used by escapeFunctionBody() to neutralize HTML script closing tags within serialized JavaScript functions. Because function bodies are sanitized in isolation before structural formatting is applied, a function whose string representation terminates directly with the sequence '</script' bypasses the positive lookahead check. When combined with serialization formatting options that introduce whitespace delimiters and a subsequent property that supplies a closing bracket, an attacker can prematurely terminate an enclosing HTML <script> block and inject arbitrary HTML or JavaScript into the rendered document.
CVE-2026-109841 is a Subresource Integrity (SRI) verification bypass vulnerability in undici, the official HTTP/1.1 and HTTP/2 client library for Node.js that powers the global fetch() implementation. The flaw stems from improper handling of case sensitivity (CWE-178) when validating cryptographic hash algorithm tokens within SRI metadata. Because undici compared incoming algorithm identifiers against a strictly lowercase set without prior ASCII-lowercase normalization, valid uppercase or mixed-case tokens such as SHA256- or Sha384- were treated as unrecognized algorithms and discarded. Under SRI forward-compatibility rules, discarding all provided tokens results in an empty integrity list, causing undici to fail open and accept tampered HTTP response bodies without cryptographic verification.