3.15.1 (2026-11-30)
Summary
A security fix for the HTML to text conversion. Crafted HTML could get past the nesting depth check and keep the event loop busy for seconds per message.
Who should upgrade
- Everyone who parses untrusted mail with the default options. An HTML part of alternating unclosed tags such as
<li><p>was not counted as nested, and converting it to text took time that grows with the square of its size (1.8 s for a 410 KB message). - Not affected if you parse with
skipHtmlToText: true.
Highlights
- The nesting depth of an HTML part is now counted by htmlparser2, the same parser that does the conversion, so the check and the conversion can not disagree. Such a message is refused in milliseconds: its
textis empty,textConversionErroris set, and the HTML, headers and attachments are returned as before. Thanks to Yeonghun Kim of Theori, with Xint, for the report. - nodemailer updated to 10.6.2.