GHSA-3Q53-MVFW-Q9V8
addressparser truncates a domain at whitespace or a comment before a dot, so the envelope recipient differs from the address an RFC 5322 parser reads
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-3Q53-MVFW-Q9V8 divulgada · CVSS 6.5 (GitHub) | |
| Remediación | Parche 10.4.1 | nodemailer · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Vulnerability summary
Tested on nodemailer 10.4.0 (latest), Node.js 22, default options. When the domain of an address contains whitespace or an RFC 5322 comment immediately before a dot, `addressparser` ends the address there and moves the rest of the domain into the display name. RFC 5322 (`obs-domain`: atoms with optional CFWS around the dots) and parsers that follow it read the full domain. `sendMail()` uses the truncated address as the SMTP envelope recipient. This is the same class as GHSA-m943-m63m-w62w, GHSA-85x2-q946-cp5h, GHSA-8c8m-p3m8-cjg8 and GHSA-g73g-hqqh-jr95; those fixes are present in 10.4.0 and do not cover this shape.
### Attacker capabilities
The attacker controls a single address string that an application passes to nodemailer in `to`, `cc`, `bcc` or `replyTo`, for example an invitation recipient, a "share by e-mail" field or a sign-up address. The attacker has no access to the application's code, configuration, SMTP credentials or mail server.
### Realistic exploitation scenario
An application restricts which recipients a user may mail (for example "invitations may only go to addresses in our organisation's domain `allowed.example`") and enforces this by checking the domain of the submitted address, either with an RFC 5322 parser or with a suffix test on the string, and then passes the same string to `sendMail()`. The attacker submits `ceo@victim.example .allowed.example`. The check sees a domain ending in `.allowed.example` and accepts it; nodemailer derives the envelope recipient `ceo@victim.example` and delivers the message to an arbitrary third party from the application's sending domain. Prerequisite: the application validates the address with something other than nodemailer's own parser and passes the raw string on, which is common because nodemailer does not export a validation API. Boundary crossed: the application's recipient restriction.
What I verified: the parser output and the envelope nodemailer builds (below), and that Python 3.11's `email` parsers read the full domain. What I have not done: identify a specific deployed application with this validation pattern.
Proof of concept
const nodemailer = require('nodemailer'); // 10.4.0
const t = nodemailer.createTransport({ jsonTransport: true }); // nothing is sent
t.sendMail({ from: 'app@sender.example', to: 'ceo@victim.example .allowed.example', subject: 's', text: 'x' })
.then(info => console.log(info.envelope.to));Observed: `[ 'ceo@victim.example' ]`. Expected: either `ceo@victim.example.allowed.example` (RFC reading) or a rejected address.
| `to` value | nodemailer envelope recipient | Python `email` `addr_spec` |
|---|---|---|
| `ceo@victim.example .allowed.example` | `ceo@victim.example` | `ceo@victim.example.allowed.example` |
| `CEO <ceo@victim.example(x).allowed.example>` | `ceo@victim.example` | `ceo@victim.example.allowed.example` |
### Security impact
An attacker can make an application send mail to a recipient outside the set the application intended to allow, using the application's sender identity and reputation (unsolicited or phishing mail to third parties, or leaking message content meant for an internal domain). Affected are applications that gate recipients by domain and pass user-supplied address strings to nodemailer. It is a security issue rather than a formatting bug because the address nodemailer delivers to is not the address a conforming parser, and therefore the application's check, sees.
The same parsing behaviour exists in postal-mime 4.2.0 and has been reported there privately (GHSA-jh3p-792r-98gm).
### Reporting requirements
- [x] I have read the Security Policy.
- [x] I have verified the finding against a supported version.
- [x] I have described a credible attacker-controlled scenario.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmnodemailer |
Corregida | 10.4.1 | 0 d | 10.6.0 no afectada |
10.4.1Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/nodemailer/nodemailer/security/advisories/GHSA-3q53-mvfw-q9v8Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
