Vulnerabilities in pkg:npm/nodemailer

PACKAGE
Advisory Identifier: GHSA-prgh-xp8r-p3m5
Advisory Summary

CVE-2026-90776 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Nodemailer addressparser libraries in the npm ecosystem. The issue involves o(n^2) on comment-joined addresses enables a remote dos (reachable via mailparser). Remediation is available by upgrading affected packages to version 10.0.5.

25 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/nodemailer

25 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/nodemailer. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-prgh-xp8r-p3m5 CVE-2026-90776 HIGH Nodemailer addressparser: O(n^2) on comment-joined addresses enables a remote DoS (reachable via mailparser)
GHSA-vm5r-23w9-m8hx - HIGH Duplicate Advisory: Nodemailer addressparser: O(n^2) on comment-joined addresses enables a remote DoS (reachable via mailparser)
GHSA-r7g4-qg5f-qqm2 CVE-2026-82662 HIGH Nodemailer: Improper TLS Certificate Validation in OAuth2 Token Fetch Enables Credential Interception
GHSA-frj6-5rhh-vwfw - HIGH Duplicate Advisory: Nodemailer: Improper TLS Certificate Validation in OAuth2 Token Fetch Enables Credential Interception
GHSA-g57g-f23g-4646 - MODERATE Nodemailer: Quoted local-part can produce malformed envelope recipient through RFC 5322 comment parsing
GHSA-v53p-9fqp-m79j - HIGH Nodemailer: Quadratic backtracking in the addressparser free-text fallback allows remote denial of service
GHSA-8vvx-rff5-p5rq - MODERATE Nodemailer: Nested structured recipient arrays bypass the parser depth limit and cause stack exhaustion DoS
GHSA-6vj9-mwq6-2f5v - MODERATE Nodemailer: Process-global DNS cache reuses TLS `servername` across transports, enabling cross-tenant SMTP credential disclosure
GHSA-wmmp-3585-3rmp - MODERATE Nodemailer: IDN/Punycode domain allow-list bypass leads to email delivery to an attacker-controlled domain
GHSA-2x7j-588g-ccc2 - HIGH Nodemailer: Quadratic (O(n²)) time complexity in addressparser allows remote denial of service via a crafted address list
GHSA-cc9r-2j5m-2m83 - MODERATE Nodemailer: Recipient-domain validation bypass via RFC 5322 comment mis-parsing leads to email delivery to an attacker-controlled domain
GHSA-8m3c-c648-2xjj - MODERATE Nodemailer: resolveContent() on a MailMessage bypasses disableFileAccess/disableUrlAccess when called with the legacy signature
GHSA-p6gq-j5cr-w38f CVE-2026-82659 HIGH Nodemailer: Message-level raw option bypasses disableFileAccess/disableUrlAccess, enabling arbitrary file read and full-response SSRF in the delivered message
GHSA-h3hj-cmcx-xc66 - HIGH Duplicate Advisory: Nodemailer: Message-level raw option bypasses disableFileAccess/disableUrlAccess, enabling arbitrary file read and full-response SSRF in the delivered message
GHSA-rcmh-qjqh-p98v CVE-2025-14874 HIGH Nodemailer’s addressparser is vulnerable to DoS caused by recursive calls
GHSA-268h-hp4c-crq3 - MODERATE Nodemailer: CRLF injection in Nodemailer List-* header comments allows arbitrary message header injection
GHSA-wqvq-jvpq-h66f - MODERATE Nodemailer jsonTransport bypasses disableFileAccess and disableUrlAccess during message normalization
GHSA-jj37-3377-m6vv - HIGH Duplicate Advisory: Nodemailer: Email to an unintended domain can occur due to Interpretation Conflict
GHSA-vvjj-xcjg-gr5g - MODERATE Nodemailer Vulnerable to SMTP Command Injection via CRLF in Transport name Option (EHLO/HELO)
GHSA-c7w3-x93f-qmm8 - LOW Nodemailer has SMTP command injection due to unsanitized `envelope.size` parameter
GHSA-46j5-6fg5-4gv3 - MODERATE Duplicate Advisory: Nodemailer is vulnerable to DoS through Uncontrolled Recursion
GHSA-mm7p-fcc7-pg87 CVE-2025-13033 MODERATE Nodemailer: Email to an unintended domain can occur due to Interpretation Conflict
GHSA-9h6g-pr28-7cqp - MODERATE nodemailer ReDoS when trying to send a specially crafted email
GHSA-hwqf-gcqm-7353 CVE-2021-23400 MODERATE Header injection in nodemailer
GHSA-48ww-j4fc-435p CVE-2020-7769 CRITICAL Command injection in nodemailer

CVE-2026-90776 at a Glance

CVE Identifier CVE-2026-90776
GHSA Identifier GHSA-prgh-xp8r-p3m5
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Nodemailer addressparser
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-90776

To remediate this vulnerability, upgrade all affected Nodemailer addressparser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nodemailer fixed: 10.0.5
npm install nodemailer@10.0.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls nodemailer

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-90776, inspect your project dependencies using npm:

npm ls nodemailer

Analyze the terminal output to locate any version of Nodemailer addressparser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.0.5), your application is affected.

Note: The npm ls nodemailer command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Nodemailer addressparser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary `nodemailer/lib/addressparser` parses one shape of address in O(n^2) time. A single ~640 KB address value blocks the Node.js event loop for roughly 7 seconds. And it is reachable without auth: mailparser feeds inbound email headers straight into this parser, so one crafted email is enough to stall a service that parses mail. ### Details The parser builds a single address by accumulating its atoms into one string. When the atoms are separated by RFC 5322 comments, like `a@b(c)@b(c)@b(c)...`, every atom re-joins that same growing string. The join check in `src/addressparser/index.ts`: ```js const joins = prevToken && prevToken.noBreak && parts.length && (prevToken.value !== ')' || parts[parts.length - 1].slice(-1) === '@' || token.value.charAt(0) === '@'); ``` The issue is the order of the last two operands. `parts[parts.length - 1].slice(-1)` runs before the cheap `token.value.charAt(0)`. `slice(-1)` has to flatten the accumulator to read its last character → O(current length) → and that runs on every token → O(n^2) over the whole value. Since `||` is left to right, the cheap `charAt(0)` that would short-circuit never gets the chance. The chain: long comment-joined address → one growing accumulator → `slice(-1)` re-flattens it on every token → quadratic parse time. ### PoC Isolated, just the parser (`npm i nodemailer@10.0.3`): ```js const addressparser = require('nodemailer/lib/addressparser'); const s = Date.now(); addressparser('a' + '@b(c)'.repeat(130000)); console.log(Date.now() - s, 'ms'); // ~7000 ms, blocking ``` End to end through mailparser, the remote path (`npm i mailparser@3.9.24`): ```js const { simpleParser } = require('mailparser'); (async () => { const to = 'a' + '@b(c)'.repeat(130000); const eml = `From: a@b.com\r\nTo: ${to}\r\nSubject: x\r\n\r\nhi\r\n`; const s = Date.now(); await simpleParser(eml); console.log(Date.now() - s, 'ms'); // ~7000 ms, blocking })(); ``` Timings measured on 10.0.3: | Address value | Parse time | | --- | --- | | 390 KB | 1.3 s | | 585 KB | 5.6 s | | 640 KB | 6.7 s | | 976 KB | 18 s | It survives RFC 5322 folding: fold the header at offsets that are a multiple of the atom length and every `)`+`@` junction stays intact, so the payload is a standards-compliant email with lines under 998 octets and still triggers it. ### Impact Algorithmic-complexity DoS. Node is single threaded, so the block stalls everything else in the process, and a handful of these back to back keeps a service down. Affected: anything that runs `addressparser` on attacker-controlled input, either the public export directly or address headers built from user input. The unauthenticated remote case is mailparser. 3.9.24 pins nodemailer 10.0.3 and calls the parser on inbound `To`/`From`/`Cc` with no length cap, so any service parsing inbound mail with it can be frozen by a single email. ### Suggested fix Swap the last two operands so the cheap check runs first: ```js (prevToken.value !== ')' || token.value.charAt(0) === '@' || parts[parts.length - 1].slice(-1) === '@') ``` Pure boolean commutation, so the parse output is identical. Verified byte for byte on the test inputs, and the full 1276-test suite passes.

CVE-2026-90776 Affected Nodemailer addressparser Versions

1 component(s)
Fixed Versions:
10.0.5
Product / Package Ecosystem Affected Versions Fixed Version
nodemailer
npm
≥ 9.1.0
< 10.0.5
10.0.5

References

Frequently Asked Questions

What is CVE-2026-90776?
CVE-2026-90776 is a security vulnerability in Nodemailer addressparser involving O(n^2) on comment-joined addresses enables a remote DoS (reachable via mailparser) under CWE-400: Uncontrolled Resource Consumption.
Which Nodemailer addressparser versions are affected?
Affected versions include releases prior to 10.0.5 across affected packages: nodemailer.
What version fixes CVE-2026-90776?
Upgrading to 10.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nodemailer affected?
Yes, nodemailer is affected in releases prior to 10.0.5. Upgrade your dependency to 10.0.5 or later.
What is the CVSS score of CVE-2026-90776?
CVE-2026-90776 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-90776?
CVE-2026-90776 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2026-90776?
Run the dependency tree command: 'npm ls nodemailer'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-prgh-xp8r-p3m5",
  "modified" : "2026-10-05T23:30:09Z",
  "published" : "2026-09-30T14:41:01Z",
  "aliases" : [ "CVE-2026-90776" ],
  "summary" : "Nodemailer addressparser: O(n^2) on comment-joined addresses enables a remote DoS (reachable via mailparser)",
  "details" : "### Summary\n\n`nodemailer/lib/addressparser` parses one shape of address in O(n^2) time. A single ~640 KB address value blocks the Node.js event loop for roughly 7 seconds. And it is reachable without auth: mailparser feeds inbound email headers straight into this parser, so one crafted email is enough to stall a service that parses mail.\n\n### Details\n\nThe parser builds a single address by accumulating its atoms into one string. When the atoms are separated by RFC 5322 comments, like `a@b(c)@b(c)@b(c)...`, every atom re-joins that same growing string.\n\nThe join check in `src/addressparser/index.ts`:\n\n```js\nconst joins =\n    prevToken &&\n    prevToken.noBreak &&\n    parts.length &&\n    (prevToken.value !== ')' || parts[parts.length - 1].slice(-1) === '@' || token.value.charAt(0) === '@');\n```\n\nThe issue is the order of the last two operands. `parts[parts.length - 1].slice(-1)` runs before the cheap `token.value.charAt(0)`. `slice(-1)` has to flatten the accumulator to read its last character → O(current length) → and that runs on every token → O(n^2) over the whole value. Since `||` is left to right, the cheap `charAt(0)` that would short-circuit never gets the chance.\n\nThe chain: long comment-joined address → one growing accumulator → `slice(-1)` re-flattens it on every token → quadratic parse time.\n\n### PoC\n\nIsolated, just the parser (`npm i nodemailer@10.0.3`):\n\n```js\nconst addressparser = require('nodemailer/lib/addressparser');\nconst s = Date.now();\naddressparser('a' + '@b(c)'.repeat(130000));\nconsole.log(Date.now() - s, 'ms'); // ~7000 ms, blocking\n```\n\nEnd to end through mailparser, the remote path (`npm i mailparser@3.9.24`):\n\n```js\nconst { simpleParser } = require('mailparser');\n(async () => {\n  const to = 'a' + '@b(c)'.repeat(130000);\n  const eml = `From: a@b.com\\r\\nTo: ${to}\\r\\nSubject: x\\r\\n\\r\\nhi\\r\\n`;\n  const s = Date.now();\n  await simpleParser(eml);\n  console.log(Date.now() - s, 'ms'); // ~7000 ms, blocking\n})();\n```\n\nTimings measured on 10.0.3:\n\n| Address value | Parse time |\n| --- | --- |\n| 390 KB | 1.3 s |\n| 585 KB | 5.6 s |\n| 640 KB | 6.7 s |\n| 976 KB | 18 s |\n\nIt survives RFC 5322 folding: fold the header at offsets that are a multiple of the atom length and every `)`+`@` junction stays intact, so the payload is a standards-compliant email with lines under 998 octets and still triggers it.\n\n### Impact\n\nAlgorithmic-complexity DoS. Node is single threaded, so the block stalls everything else in the process, and a handful of these back to back keeps a service down.\n\nAffected: anything that runs `addressparser` on attacker-controlled input, either the public export directly or address headers built from user input. The unauthenticated remote case is mailparser. 3.9.24 pins nodemailer 10.0.3 and calls the parser on inbound `To`/`From`/`Cc` with no length cap, so any service parsing inbound mail with it can be frozen by a single email.\n\n### Suggested fix\n\nSwap the last two operands so the cheap check runs first:\n\n```js\n(prevToken.value !== ')' || token.value.charAt(0) === '@' || parts[parts.length - 1].slice(-1) === '@')\n```\n\nPure boolean commutation, so the parse output is identical. Verified byte for byte on the test inputs, and the full 1276-test suite passes.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nodemailer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.1.0"
      }, {
        "fixed" : "10.0.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 10.0.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nodemailer/nodemailer/security/advisories/GHSA-prgh-xp8r-p3m5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-90776"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodemailer/nodemailer/commit/c07f17518d25aca8ab2ad66968dcbca538c24b89"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nodemailer/nodemailer"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodemailer/nodemailer/releases/tag/v10.0.5"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/nodemailer-9.1.0-through-10.0.4-denial-of-service-via-quadratic-address-parsing"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400", "CWE-407" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-30T14:41:01Z",
    "nvd_published_at" : null
  }
}