zbateson/mail-mime-parser has CRLF header injection via attachment filename
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
zbateson/mail-mime-parser is a mail mime parser alternative to PHP's imap* functions and Pear libraries for reading messages in Internet Message Format RFC 822. Prior to version 3.0.6 and 4.0.2, CRLF (carriage-return / line-feed) header injection (CWE-93) affecting any application that uses this library to build or forward MIME messages with an attacker-influenced attachment filename. Attachment filenames are interpolated into the `Content-Type` and `Content-Disposition` header values without stripping CR/LF, so a filename containing `\r\n` serializes as one or more additional, attacker-controlled header lines (for example a forged `Bcc:` that silently exfiltrates a copy of the outgoing message). The untrusted filename can come directly from parsed inbound mail, so no local construction is required — an application that re-attaches or re-sends a parsed filename is exposed. Versions 3.0.6 and 4.0.2 patch the issue. Versions 1.x and 2.x are also affected but are end-of-life and will not receive patches; users on those lines should upgrade to a fixed release. If upgrading is not immediately possible, strip CR and LF from any filename before passing it to attachment APIs, and from the result of getFilename() before reusing it in a constructed message — e.g. preg_replace('/[\r\n]+/', ' ', $filename).
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| zbateson | mail-mime-parser | before 3.0.6; 4.0.0 to before 4.0.2 | 3.0.6, 4.0.2 | Patch available | CNA |
| — | zbateson/mail-mime-parser (Packagist) | before 3.0.6 | 3.0.6 | Patch available | GHSA-36h5-qg4p-q2qf |
| — | zbateson/mail-mime-parser (Packagist) | 4.0.0 to before 4.0.2 | 4.0.2 | Patch available | GHSA-36h5-qg4p-q2qf |
- mail-mime-parser Vendorzbateson Affected before 3.0.6; 4.0.0 to before 4.0.2 Fixed in 3.0.6, 4.0.2 Patch available CNA
- zbateson/mail-mime-parser (Packagist) Vendor— Affected before 3.0.6 Fixed in 3.0.6 Patch available GHSA-36h5-qg4p-q2qf
- zbateson/mail-mime-parser (Packagist) Vendor— Affected 4.0.0 to before 4.0.2 Fixed in 4.0.2 Patch available GHSA-36h5-qg4p-q2qf
Remediation
- Fix · CNA mail-mime-parser (zbateson) Fixed in 3.0.6, 4.0.2
- Fix · GHSA-36h5-qg4p-q2qf zbateson/mail-mime-parser (Packagist) Fixed in 3.0.6 Advisory →
- Fix · GHSA-36h5-qg4p-q2qf zbateson/mail-mime-parser (Packagist) Fixed in 4.0.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-61815
- 2026-10-03 Alias added: GHSA-36h5-qg4p-q2qf
- 2026-10-05 CISA SSVC decision points changed
References
Other 6
- https://github.com/zbateson/mail-mime-parser/security/advisories/GHSA-36h5-qg4p-q2qf
- https://github.com/zbateson/mail-mime-parser/commit/81859c06abb5d79f04b7a3254d293d0a91065948
- https://github.com/zbateson/mail-mime-parser/commit/d2970b5df266f62e5ee8e675bfb05502b70fc6e1
- https://github.com/zbateson/mail-mime-parser
- https://github.com/zbateson/mail-mime-parser/releases/tag/3.0.7
- https://github.com/zbateson/mail-mime-parser/releases/tag/4.0.2
More zbateson vulnerabilities
- TI-2026-44241 zbateson/mail-mime-parser has uncontrolled resource consumption (CPU/memory DoS) parsing untrusted MIME CVSS 3.1HIGH 7.5
- TI-2026-85057 CRLF header injection in zbateson mail-mime-parser message builders CVSS 4.0MEDIUM 6.9
Sources
- CVE-2026-61815 · CVE Program
- CVE-2026-61815 · NVD
- FIRST EPSS
- GHSA-36h5-qg4p-q2qf · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences