GHSA-f2hq-32vh-53cc: High severity npm/postal-mime vulnerability

Published Oct 23, 2026
·
Updated

Impact

Decoding a header that holds a long run of joinable RFC 2047 base64 encoded words, such as =?utf-8?B?QUJD?= repeated tens of thousands of times in a Subject, From, To, a filename or a description, took time quadratic in the number of words. The join check ran a regex over the text joined so far for every word, which flattens the accumulated string each time. A single well formed message of about 1.6 MB blocked the event loop for one to twenty seconds depending on the host, and inline message/rfc822 parts multiplied the cost, since each nested message carried its own header budget.

Any application that parses untrusted mail with postal-mime 3.0.0 through 4.0.7, including the exported decodeWords() helper, is affected. There is no confidentiality or integrity impact.

Patches

Fixed in 4.0.8. The pad check now tracks the last appended word instead of testing the joined text, so decoding is linear in the header length. The same release also counts the parts and header bytes of inline message/rfc822 sub-messages against the limits of the message as a whole, counts every header line for at least 64 bytes of maxHeadersSize, and adds a scaling test that measures every stage of the parser at two input sizes.

Workarounds

Lower maxHeadersSize from its 2 MiB default to bound the cost per message, or parse untrusted mail in a worker that can be terminated.

Credits

Reported by Felipe Fernández.

Affected Software

1 affected componentFixes available
npm/postal-mime>=3.0.0<4.0.8
4.0.8

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/postal-mime to a version that resolves this vulnerability.

    Fixed in 4.0.8
  2. Upgrade

    Upgrade postal-mime to a version that resolves this vulnerability.

    Fixed in 4.0.8
  3. Configuration

    Lower maxHeadersSize from its 2 MiB default to bound the cost per message.

    postal-mime maxHeadersSize = lower than 2 MiB
  4. Compensating control

    Parse untrusted mail in a worker that can be terminated.

Event History

Oct 23, 2026
Advisory Published
via GitHub·09:54 PM
Data Sourced
via GitHub·09:54 PM
DescriptionSeverityWeaknessAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203