Skip to content
Threat Feed
high threat exploited

CRLF Header Injection Vulnerability in mail-mime-parser

The zbateson/mail-mime-parser library is vulnerable to CRLF header injection (CVE-2026-61815), allowing attackers to inject arbitrary email headers such as Bcc for silent data exfiltration.

CVE search metadata

CVE search record: CVE-2026-61815. Severity: high. CVSS: 7.2. KEV: no. Product: mail-mime-parser (v3.0.6, v4.0.2), mail-mime-parser (2.0.0-3.0.5, 4.0.0-4.0.1). Brief: CRLF Header Injection Vulnerability in mail-mime-parser. Brief link: https://feed.craftedsignal.io/briefs/2026-09-mail-mime-parser-crlf/

What's new

  • 1. added coverage for mail-mime-parser (2.0.0-3.0.5, 4.0.0-4.0.1) Sep 24, 20:04 via ghsa

The zbateson/mail-mime-parser library (versions < 3.0.6 and 4.0.0 through 4.0.1) contains a CRLF header injection vulnerability, identified as CVE-2026-61815. The flaw exists because the library fails to properly sanitize carriage-return (CR) and line-feed (LF) characters from attachment filenames during both the parsing of inbound MIME messages and the construction of outbound messages.

An attacker can exploit this by crafting a malicious attachment filename containing encoded CRLF characters. When an application parses a message containing such a filename and subsequently re-attaches or re-forwards the file, the library inadvertently serializes the CRLF characters into the email headers. This allows the attacker to inject arbitrary email headers, such as 'Bcc', enabling the silent exfiltration of email content to an attacker-controlled address. This vulnerability affects any application logic that retrieves a filename from a parsed message and uses it to construct a new MIME part.

Impact

Successful exploitation allows for the silent exfiltration of sensitive email communications via unauthorized 'Bcc' header injection. Any enterprise application that automatically processes, forwards, or re-attaches files from inbound emails using the vulnerable library version is at risk.

Recommendation

Prioritized, concrete actions:

  • Upgrade the zbateson/mail-mime-parser library to version 3.0.6 or 4.0.2 immediately.
  • If immediate patching is not feasible, implement a strict sanitization routine to strip CR and LF characters from any filename retrieved via getFilename() before using it in any outbound email construction, such as: preg_replace('/[\r\n]+/', ' ', $filename).
  • Conduct a code review of downstream applications using mail-mime-parser to identify instances where filenames parsed from inbound messages are reused in outgoing mail construction.

Immediate actions

Upgrade mail-mime-parser to 3.0.6 or 4.0.2

IT Operations 48h

Mitigations

Implement CRLF sanitization on filename parameters in code

immediate Application Development

CVE-2026-61815

Indicators of compromise

1

email

TypeValue
emailattacker@evil.test