Sep 25, 2026·6 min read·36 visits
A denial of service vulnerability in zbateson/mail-mime-parser allows unauthenticated remote attackers to trigger severe CPU exhaustion or out-of-memory crashes by submitting malformed emails under 2 MB containing deeply nested boundaries, large header lists, or dense sibling attachments.
The PHP email processing library zbateson/mail-mime-parser is vulnerable to multiple algorithmic complexity exploits. By submitting small, highly structured email payloads, remote, unauthenticated attackers can trigger high CPU utilization or out-of-memory states, causing an application-wide denial of service.
The library zbateson/mail-mime-parser serves as a PHP-based alternative to native IMAP functions and Pear libraries for decoding RFC 822 and MIME compliant email structures. It is commonly implemented in webmail applications, customer support ticketing desks, and mail gateway APIs to process inbound email traffic. Because these systems ingest untrusted payloads directly from the public internet, any processing inefficiencies in the parser represent a significant remote attack vector.
Three independent execution pathways within the parser exhibit super-linear time complexity or unbound memory usage patterns. This vulnerability class, categorized under CWE-400 (Uncontrolled Resource Consumption), allows attackers to systematically bypass physical size constraints (such as a 2 MB or 10 MB maximum request limit) by optimizing payload complexity rather than file volume. An input document of negligible physical size can force host systems to stall processing threads indefinitely or exhaust the available RAM allocation.
The parsing operations in mail-mime-parser are designed to execute lazily. However, the costly super-linear evaluation is forced on the target host as soon as the calling application performs its first full-text read or executes the getAllParts() API. Consequently, passive application-level checks are incapable of stopping the exhaustion cycle once a message is loaded into memory.
The underlying vulnerability stems from three distinct structural mechanics within the parser's logic. These mechanics fail to constrain execution iteration or structure allocation limits, enabling predictable and repeatable algorithmic failure states.
During multipart boundary discovery, the parser evaluates each read line against the boundary of the active part and its parent structures. When processing a MIME document with nesting depth $D$, the parser traverses up the proxy hierarchy to verify if a line signifies the end of a parent structure. Under deep recursion, this parent traversal executes dynamically via helper functions. If the message contains $D$ nested multipart objects, evaluating the boundary termination for each line triggers $O(D^2)$ boundary comparisons, translating directly to excessive CPU cycles for relatively low-byte inputs.
When a multipart MIME container processes a sequence of sibling attachments, each node is sequentially registered into the internal tree configuration using PartChildrenContainer::add. The unpatched method used PHP's native \array_splice function to insert elements into the container structure. Because \array_splice causes PHP to rebuild and re-index the internal array from scratch, inserting $N$ sibling parts sequentially results in $O(N^2)$ memory and processor operations. This forces high-frequency array shift operations that lock up the execution thread.
The class HeaderParserService::parse() reads RFC 822 header groups using an unconstrained loop that terminates only when encountering an empty line. Each header line is decoded and mapped to individual PHP objects. Because the parser does not limit either the total count of headers or the aggregate size of the header block, a payload containing tens of thousands of mock headers can easily overwhelm memory boundaries. Due to internal object management structures in PHP, a small array of thousands of small headers can expand exponentially in RAM usage, leading to a kernel Out-Of-Memory (OOM) termination of the parent PHP-FPM pool or worker process.
The mitigation and patch history illustrates how minor architectural details in PHP array and loop implementations can trigger catastrophic resource exhaustion.
In the vulnerable version of PartChildrenContainer.php, elements were appended by passing a computed default index directly into \array_splice:
// Vulnerable Implementation
public function add(IMessagePart $part, ?int $position = null) : static
{
$index = $position ?? \count($this->children);
\array_splice(
$this->children,
$index,
0,
[$part]
);
return $this;
}The patch addresses this structural vulnerability by introducing a fast-path bypass. When the position is unspecified or evaluates to the end of the array, the element is appended directly using PHP's native bracket syntax, which executes in $O(1)$ amortized complexity instead of rebuilding the array via \array_splice:
// Patched Implementation in v3.0.6 & v4.0.2
public function add(IMessagePart $part, ?int $position = null) : static
{
if ($position === null || $position >= \count($this->children)) {
$this->children[] = $part;
} else {
\array_splice(
$this->children,
$position,
0,
[$part]
);
}
return $this;
}The class HeaderParserService.php was altered to enforce maximum thresholds, preventing unbounded memory growth. The patched parser tracks both the total processed headers and the size offset dynamically via \ftell:
// Patched Header Parsing Loop with Limits
if ($count >= $this->maxHeaderCount || \ftell($handle) - $start >= $this->maxHeaderSizeBytes) {
$container->addError(
'Header count or total size limit reached while parsing headers',
LogLevel::ERROR
);
break;
}Exploiting this vulnerability does not require complex memory corruption techniques or bypasses of standard exploit mitigations (such as ASLR or DEP). Instead, the attacker sends a syntactically valid email structured to maximize the algorithmic load on the backend server.
An attacker can craft a payload leveraging Vector A, which nests 300+ multipart groups inside one another. The outer structures are progressively left open, requiring the parser to traverse the entire parent chain recursively for every single character read. A proof-of-concept file payload demonstrating this behavior can be smaller than 200 KB yet require up to 30 seconds of high-priority CPU time on modern infrastructure.
Alternatively, an attacker can target Vector C by supplying thousands of mock headers (e.g., X-Header-1: A\r\n, X-Header-2: B\r\n, etc.). Because PHP applications generally share worker pools (like PHP-FPM or Apache mod_php), exhausting all available processes or triggering OOM failures on the pool quickly leads to an application-wide HTTP 502/504 Bad Gateway or Service Unavailable state.
To remediate these issues, the vendor introduced configuration properties in di_config.php to define and enforce threshold caps. By default, the parser now restricts the maximum MIME part nesting depth to 256, the maximum header count to 1000, and the maximum cumulative header size to 1,048,576 bytes.
While these limits successfully disrupt the exploit vectors, a minor residual risk remains. If an attacker passes a single, continuous header line of several megabytes, the loop validation in HeaderParserService::parse is not triggered until after the entire line has been read and loaded into a single string buffer. If the system memory configuration is low, a single massive string operation could still trigger an unexpected OOM crash before the boundary verification is reached.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
mail-mime-parser zbateson | >= 2.0.0, < 3.0.6 | 3.0.6 |
mail-mime-parser zbateson | >= 4.0.0, < 4.0.2 | 4.0.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-400 |
| Attack Vector | Network (AV:N) |
| CVSS Score | 7.5 (High) |
| Impact | Denial of Service (DoS) |
| Exploit Status | Proof of Concept (PoC) |
| KEV Status | Not Listed |
The software does not properly control the allocation and maintenance of a limited resource, enabling an actor to influence the amount of resources consumed and trigger a Denial of Service.
CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.
An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.
GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.
CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.
CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.
An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.