Sep 25, 2026·6 min read·37 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-16454 is an object-level authorization bypass vulnerability (CWE-284, CWE-862) in Eclipse hawkBit versions 1.0.3 and prior. The flaw exists within the Direct Device Integration (DDI) REST controller (hawkbit-ddi-resource), where endpoints responsible for enumerating software module metadata and serving firmware binaries fail to verify whether the requested software module is assigned to the authenticated device. Consequently, any device with valid credentials (such as a TargetToken or GatewayToken) can enumerate software module identifiers and download arbitrary firmware artifacts across the entire tenant namespace.
CVE-2026-62284 (GHSA-5w5g-j6hw-6p8f) is a code injection and server-side request forgery vulnerability in the console-proxy component of the OSAC Operator. The RemoteConfigResolver parses Kubernetes Secrets containing kubeconfig files via clientcmd.RESTConfigFromKubeConfig without sanitizing execution-related fields. An attacker with RBAC permissions to create or modify labeled Secrets in monitored namespaces can supply a malicious exec credential plugin, resulting in arbitrary command execution within the console-proxy pod.
CVE-2026-62361 (GHSA-xgjr-7j9q-2h4r) is an authenticated SQL injection and authorization bypass vulnerability in listmonk, an open-source, self-hosted newsletter and mailing list manager written in Go. In versions prior to 6.2.0, the subscriber export endpoint (GET /api/subscribers/export) directly interpolates user-supplied SQL filter expressions into a PostgreSQL query without invoking the table allowlist validation function (validateQueryTables). Consequently, authenticated users possessing the subscribers:sql_query and subscribers:get_all permissions can bypass relational access controls, execute arbitrary subqueries against restricted tables such as users and settings, and modify database state via writable Common Table Expressions (CTEs).
CVE-2026-28385 (GHSA-3gq2-x4qg-p4g6) is a Server-Side Request Forgery (SSRF) vulnerability in Canonical LXD versions 4.12 through 6.9. An authenticated user possessing the can_create_images entitlement can force the LXD daemon to execute arbitrary outbound HTTP and HTTPS requests via the /1.0/images API endpoint. Due to the absence of egress destination validation, an attacker can probe host loopback services, RFC 1918 private network segments, and cloud Instance Metadata Services (IMDS) from the network position of the privileged LXD daemon.
Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.
CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.