GHSA-2x7j-588g-ccc2: Nodemailer: Quadratic (O(n²)) time complexity in addressparser allows remote denial of service via a crafted address list
Nodemailer’s address parser (lib/addressparser/index.js) parses a list of comma‑separated addresses in quadratic time — O(n²) in the number of addresses. A single crafted address string (e.g. a To, Cc, Bcc, From, or Reply‑To value, or any value passed to the exported addressparser) therefore consumes CPU proportional to the square of its length and blocks Node’s single‑threaded event loop for the entire duration, denying service to every other request in the process.
This requires no special application configuration and no cooperating receiver — it is entirely inside the parser and triggers on the library’s default code path. A ~1.5 MB address value freezes the process for ~25–30 seconds of 100% CPU; the cost grows with the square of the input, so a few‑MB value stalls the server for minutes. It is a distinct issue from the recursion DoS fixed as CVE‑2025‑14874 (that path is guarded by a nesting‑depth cap; this one is a flat, comma‑separated list with no such limit).
References
- github.com/advisories/GHSA-2x7j-588g-ccc2
- github.com/nodemailer/nodemailer/commit/34da64282dcdc9b0581c721a27ab2fa226673150
- github.com/nodemailer/nodemailer/commit/7cc38af418ffa6fc7e86085195ca5ca681694b3e
- github.com/nodemailer/nodemailer/commit/9116da9528c6524cefaed75185602a7e85d20434
- github.com/nodemailer/nodemailer/pull/1848
- github.com/nodemailer/nodemailer/releases/tag/v9.1.0
- github.com/nodemailer/nodemailer/security/advisories/GHSA-2x7j-588g-ccc2
Code Behaviors & Features
Detect and mitigate GHSA-2x7j-588g-ccc2 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →