Impact
Nodemailer versions 5.0.0 through 10.0.1 store DNS lookup results in a global cache keyed only by host, while also storing the TLS servername chosen by the caller. This vulnerable behavior corresponds to CWE-295. When two separate transports resolve the same hostname with different tls.servername values, the first lookup populates the cache and subsequent resolves retrieve that entry, causing the second transport to use the wrong SNI value. As a result the server presents a certificate for an unintended TLS virtual host, which the client may accept even when rejectUnauthorized is true because the certificate is validated against the incorrect identity. In a multi‑tenant environment or when an SMTP gateway routes by SNI, an attacker who can prime this cache can force a victim transport to connect to an attacker‑controlled TLS host and accept a forged certificate, thereby leaking the victim’s SMTP credentials.
Affected Systems
Vendor: Nodemailer; Product: Nodemailer library; Affected versions: 5.0.0 to 10.0.1 inclusive. The problem exists whenever the library is used to establish direct TLS or SMTPS transports (configurable with secure: true).
Risk and Exploitability
The CVSS base score of 6 indicates moderate severity. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog. Exploitation requires the attacker to influence the DNS cache used by Nodemailer, which may be achieved through a tenant that runs code capable of creating an SMTP transport with a distinct tls.servername. The attacker then primes the cache so that when a victim’s mail object resolves the same hostname, it receives the attacker’s SNI and certificate. This can lead to credential disclosure even when the client enforces strict certificate validation. Because the exploit depends on cache collision rather than a remote code execution, the likelihood of widespread attacks remains limited, but systems that host multiple tenants or use shared SMTP gateways should remain vigilant.
OpenCVE Enrichment