mail-parser is vulnerable to Regular Expression Denial of Service (ReDoS)
75
High Risk
The library relies on two regular expressions in its email header parsing that exhibit polynomial backtracking on externally supplied input. An address-header fallback pattern degrades to quadratic or cubic time on padded display names or repeated angle brackets, and the Received header clause splitter backtracks quadratically over long whitespace runs. Because both patterns run through the standard parsing entry points, a single small but crafted email can consume large amounts of CPU and stall a mail-processing worker. The fix replaces the patterns with linear-time scanning and collapses whitespace runs before splitting.
You are affected if you run an affected version and parse untrusted or externally supplied email through the standard entry points (parse_from_string, parse_from_bytes, parse_from_file).
mail-parser is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 4.2.0 - 4.6.0.
Upgrade the mail-parser library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant