{"id":"GHSA-85x2-q946-cp5h","summary":"Nodemailer: A \"\u003e\" inside a quoted local part ends an angle-addr early in addressparser, delivering to a domain the header does not name","details":"### Vulnerability summary\n\naddressparser ends an angle-addr at the first `\u003e` it sees, including one inside a quoted local part, a comment or a domain literal. The domain is then read off the text in front of that `\u003e`. `\u003c\"a@evil.com\u003e\"@good.com\u003e` is the mailbox `\"a@evil.com\u003e\"@good.com` under RFC 5322, and Nodemailer read it as an address at `evil.com`. The unbracketed spelling of the same value was already read correctly. Affected: 3.0.0 through 10.1.3.\n\n### Attacker capabilities\n\nThe attacker controls the text of a recipient or sender address that an application passes to Nodemailer, for example a To value entered in a contact or invite form, or the header of an inbound message parsed with mailparser. No access to the application, its configuration or its credentials is needed. The value is a syntactically valid RFC 5322 address that conformant parsers accept without defects.\n\n### Realistic exploitation scenario\n\nAn application lets users send invitations or notifications only to addresses at an allowed domain and validates the submitted value with a conformant parser or by checking its domain. The attacker submits `\u003c\"a@evil.com\u003e\"@good.com\u003e`, which validates as a `good.com` mailbox. Nodemailer then parses the same value, issues `RCPT TO:\u003c\"\\\"a\"@evil.com\u003e` and the message, with whatever content the application puts into it, is delivered to the attacker's domain. The security boundary crossed is the application's recipient allow list. In the inbound direction, mailparser reports a different address than a conformant reader of the same header, so a display or policy layer built on the two disagrees.\n\n### Proof of concept\n\n```js\nconst addressparser = require('nodemailer/lib/addressparser');\nconsole.log(addressparser(\"\u003c\\\"a@evil.com\u003e\\\"@good.com\u003e\"));\n// [ { address: '\"a@evil.com', name: '@good.com\u003e' } ]\n```\n\nPython's `email._header_value_parser.get_address_list` reads the same value as `\"a@evil.com\u003e\"@good.com`, with no defects reported.\n\nThe envelope a message gets is built from the same parse, so `sendMail({ to: \"\u003c\\\"a@evil.com\u003e\\\"@good.com\u003e\" })` issues the RCPT TO shown above.\n\n### Security impact\n\nMail that an application intends for an allowed domain is delivered to a domain chosen by the attacker, which discloses its content. It is a security vulnerability rather than a parsing bug because the misreading only occurs for values that a conformant validator approves, so validation done the right way is bypassed. Affected are applications that pass user influenced addresses to Nodemailer and consumers of the standalone parser such as mailparser.\n\nThe fix tracks quoted strings, comments and domain literals inside an angle-addr and reads only a `\u003e` outside them.\n\nFound in an internal review of addressparser on 2026-10-18. Verified on 3.0.0, 6.9.16 and 10.1.3.","modified":"2026-10-23T22:00:03.735116753Z","published":"2026-10-23T21:51:18Z","database_specific":{"cwe_ids":["CWE-20","CWE-436"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-10-23T21:51:18Z","nvd_published_at":null},"references":[{"type":"WEB","url":"https://github.com/nodemailer/nodemailer/security/advisories/GHSA-85x2-q946-cp5h"},{"type":"WEB","url":"https://github.com/nodemailer/nodemailer/commit/1cd57d2b8c49dff048c21cdbafdb54439a7f07e2"},{"type":"PACKAGE","url":"https://github.com/nodemailer/nodemailer"},{"type":"WEB","url":"https://github.com/nodemailer/nodemailer/releases/tag/v10.1.4"}],"affected":[{"package":{"name":"nodemailer","ecosystem":"npm","purl":"pkg:npm/nodemailer"},"ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"10.1.4"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-85x2-q946-cp5h/GHSA-85x2-q946-cp5h.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N"}]}