Email Address Formatting Can Add a Recipient You Did Not Choose
Email::Address::XS before version 1.06 has a formatting flaw tracked as CVE-2026-120362. The affected functions include the display-name formatting paths used when an application turns structured address data back into a message header. When a display name contains the encoded-word marker =?, the formatter can produce a header that contains additional addresses. An attacker who controls that display name can therefore add recipients to the formatted list.
This is a header-injection problem, but its impact is not limited to strange-looking mail. In a notification system, a display name may come from a user profile, a contact import, or an external address book. If the application formats that value and then hands the result to a mail transport, the extra address becomes part of the envelope or visible header according to the surrounding mail stack. That can redirect a message, expose content to a third party, or create misleading replies when downstream tools trust the header.
The library and the SMTP server have separate roles. A vulnerable formatter can create a malformed or expanded address list, while the mail transfer agent still decides whether the recipient domain is allowed, whether relaying is permitted, and whether the message is delivered. Teams should avoid describing every version match as direct remote code execution. The concrete check is whether an application accepts attacker-controlled display names and passes the output of format_email_addresses, format_email_groups, or format into a header without a second validation step.
Upgrade to Email::Address::XS 1.06 or later. Restart long-running Perl workers so the new module is loaded. Search code for the formatting functions and identify every input source. A display name from a trusted administrator is a different risk from a display name imported from a public directory. Use a strict address-list parser after formatting, reject control characters and unexpected address delimiters, and compare the number of resulting recipients with the number expected by the calling workflow.
Add a regression case with a display name containing =?, a delimiter-like sequence, and an encoded-word boundary. The test should inspect the exact header line, not only the parsed address object. For mail-disabled test environments, capture the generated message and assert that the recipient count and serialized header remain within the intended values. Avoid printing real addresses or message contents in logs.
The broader lesson is that email identity is assembled from several layers. A cosmetic display name can become a routing input when code loses the distinction between a label and an address. Teams should keep mailing templates and address transformations versioned, review changes to address libraries, and test the full path from user-controlled profile data to the final message. That test catches both this CVE and future parser disagreements.
References
- CVE-2026-120362 advisory record: https://www.cve.org/CVERecord?id=CVE-2026-120362
- oss-security discussion: https://seclists.org/oss-sec/2026/q4/924
- Email::Address::XS repository: https://github.com/pali/Email-Address-XS
Top comments (0)