CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-VVJJ-XCJG-GR5G

GHSA-VVJJ-XCJG-GR5G: SMTP Command Injection via CRLF in Nodemailer

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 8, 2026·5 min read·27 visits

Executive Summary (TL;DR)

A CRLF injection flaw in Nodemailer's connection logic allows attackers to execute arbitrary SMTP commands during the EHLO/HELO handshake, enabling email spoofing and phishing. Fixed in version 8.0.5.

Nodemailer versions up to 8.0.4 contain an SMTP command injection vulnerability due to improper neutralization of CRLF sequences in the transport name configuration. This allows attackers to inject arbitrary SMTP commands into the initial handshake.

Vulnerability Overview

Nodemailer is a widely deployed Node.js module used for sending emails. Versions 8.0.4 and earlier contain a vulnerability in the handling of the transport name configuration option. This option identifies the client to the SMTP server during the initial handshake phase.

The vulnerability is classified as CWE-93, Improper Neutralization of CRLF Sequences. An attacker who controls the name parameter can inject arbitrary SMTP commands into the connection stream. The vulnerability manifests during the ESMTP and SMTP connection phases.

The impact relies on the application exposing the SMTP transport configuration to untrusted input. Once exploited, the vulnerability allows the attacker to silently prepend raw protocol commands to the application's legitimate SMTP session.

Root Cause Analysis

The root cause resides in the lib/smtp-connection/index.js file. During connection initialization, the library assigns the name property directly from the user-provided configuration object or a default hostname helper. The library does not strip or sanitize carriage return and line feed (CRLF) characters from this value.

When establishing the session, the library constructs handshake commands by concatenating the command verb with the unsanitized name property. The _sendCommand internal method appends a terminating CRLF sequence and writes the buffer to the socket. Because the application logic does not neutralize internal CRLF sequences, the SMTP server processes the injected line breaks as command delimiters.

The unsanitized parameter propagates into the EHLO, HELO, and LHLO commands. Handshakes often repeat after a STARTTLS secure connection is established, making this parameter a persistent injection vector throughout the session lifecycle.

Code Analysis

The vulnerability is evident in the assignment logic for the connection identifier. The vulnerable implementation reads the name property without prior validation or sanitization.

// Vulnerable Implementation (lib/smtp-connection/index.js)
this.name = this.options.name || this._getHostname();

The patch introduced in commit 0a43876801a420ca528f492eaa01bfc421cc306e mitigates this issue by enforcing a strict sanitization step. The developers utilized a regular expression to strip all carriage return and line feed characters during assignment.

// Patched Implementation (lib/smtp-connection/index.js)
this.name = (this.options.name || this._getHostname()).toString().replace(/[\r\n]+/g, '');

This fix ensures that regardless of the input provided to the transport configuration, the resulting name property remains a single logical string. The SMTP protocol relies strictly on CRLF sequences for command termination. Stripping these characters entirely removes the vector for command injection, neutralizing the threat.

Exploitation

Exploitation requires the attacker to control the name property within the SMTP transport configuration. This prerequisite restricts the attack surface primarily to multi-tenant SaaS platforms, administrative panels, or environments where configuration variables are dynamically populated from untrusted sources. Once the configuration is controlled, the attacker crafts a payload containing malicious SMTP commands separated by \r\n sequences.

const transport = nodemailer.createTransport({
    host: 'smtp.target-server.com',
    port: 25,
    secure: false,
    name: 'legit.host\r\nMAIL FROM:<attacker@evil.com>\r\n'
        + 'RCPT TO:<victim@target.com>\r\nDATA\r\n'
        + 'From: ceo@company.com\r\nTo: victim@target.com\r\n'
        + 'Subject: Urgent\r\n\r\nPhishing content\r\n.\r\nRSET'
});

When the application attempts to send an email, the injected sequence executes before the legitimate payload. The EHLO command is effectively terminated early, and the subsequent MAIL FROM, RCPT TO, and DATA commands are processed by the receiving server. The attacker concludes their payload with the RSET command or a similar terminator to discard the application's appended legitimate commands.

Impact Assessment

The primary impact of this vulnerability is unauthorized email transmission and sender spoofing. By injecting raw SMTP commands, an attacker bypasses the application's intended restrictions on recipient addresses and message content. The attacker leverages the legitimate application's authorized SMTP relay to distribute malicious content.

This attack mechanism allows the threat actor to bypass domain reputation checks, Sender Policy Framework (SPF), and DomainKeys Identified Mail (DKIM) protections associated with the relay. The receiving servers interpret the emails as originating from the compromised application's infrastructure.

The CVSS v3.1 score for this vulnerability is 4.9. The score reflects a Moderate severity due to the high privileges required (PR:H) to influence the application's internal SMTP configuration. The confidentiality and availability metrics remain unaffected (C:N, A:N), while the integrity impact is high (I:H) due to the complete control over the emitted network stream.

Remediation

The vulnerability is fully resolved in Nodemailer version 8.0.5. Organizations utilizing Nodemailer must upgrade their dependencies to this version or later to ensure the name parameter is correctly sanitized. No configuration changes are required to activate the patch.

If immediate patching is not feasible, developers must implement strict input validation on any user-supplied data used in the SMTP transport configuration. The validation logic must reject any string containing carriage return (\x0d) or line feed (\x0a) characters. The application should enforce a strict allowlist of characters for the hostname parameter, limited to alphanumeric characters, hyphens, and periods.

Security teams should monitor outbound SMTP traffic for unusual patterns. Multiple command sequences transmitted in a single packet during the EHLO or HELO phases serve as an indicator of attempted command injection. WAF and network inspection tools can alert on consecutive SMTP commands found inside initial handshake sequences.

Official Patches

NodemailerVersion 8.0.5 Release Notes

Fix Analysis (1)

Technical Appendix

CVSS Score
4.9/ 10
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N

Affected Systems

Node.js applications using Nodemailer for SMTP transportMulti-tenant SaaS platforms providing custom SMTP integrations

Affected Versions Detail

Product
Affected Versions
Fixed Version
nodemailer
Nodemailer
<= 8.0.48.0.5
AttributeDetail
Vulnerability TypeCRLF Injection (Command Injection)
CWE IDCWE-93
Attack VectorNetwork
CVSS Score4.9
ImpactIntegrity (Email Spoofing, Phishing Relays)
Exploit StatusPoC Available

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1566Phishing
Initial Access
CWE-93
Improper Neutralization of CRLF Sequences

Improper Neutralization of CRLF Sequences ('CRLF Injection')

Vulnerability Timeline

Fix committed to Nodemailer repository
2026-04-07
GitHub Advisory GHSA-VVJJ-XCJG-GR5G published
2026-04-08
Nodemailer version 8.0.5 released
2026-04-08

References & Sources

  • [1]GitHub Advisory GHSA-VVJJ-XCJG-GR5G
  • [2]Nodemailer Fix Commit
  • [3]Nodemailer v8.0.5 Release Notes

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 7 hours ago•CVE-2026-48861
2.1

CVE-2026-48861: HTTP Request Splitting and Smuggling via Method Parameter CRLF Injection in Elixir Mint

CVE-2026-48861 is a client-side HTTP request-line CRLF (Carriage Return Line Feed) injection vulnerability in the popular Elixir HTTP client library, Mint. The vulnerability permits HTTP Request Splitting and HTTP Request Smuggling when an application forwards untrusted, attacker-controlled inputs to Mint's HTTP client requests as either the HTTP request method or target. By embedding CRLF characters within these parameters, an attacker can terminate the request line prematurely, inject malicious headers, or pipeline entirely independent requests. These smuggled requests are then processed by upstream or downstream proxy servers as separate HTTP queries on the same TCP connection. While Mint version 1.7.0 introduced target validation to secure the request target, the HTTP request method parameter remained completely unvalidated. This flaw allows attackers to bypass routing filters, access restricted internal APIs, or poison HTTP caches under default configurations.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 7 hours ago•CVE-2026-49753
6.3

CVE-2026-49753: HTTP Request/Response Smuggling via Inconsistent Content-Length Parsing in Elixir Mint Client

An Inconsistent Interpretation of HTTP Requests (HTTP Request/Response Smuggling) vulnerability in the Elixir Mint HTTP client allows attacker-controlled HTTP/1 servers to desynchronize response framing on shared connections due to over-lenient parsing of sign-prefixed Content-Length headers.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 8 hours ago•CVE-2026-49754
8.2

CVE-2026-49754: Denial of Service via Unbounded HTTP/2 CONTINUATION Frame Accumulation in Elixir Mint

An allocation of resources without limits or throttling vulnerability in Elixir Mint allows an attacker-controlled HTTP/2 server to exhaust memory in a Mint client. The vulnerability is exploited by sending a HEADERS frame without the END_HEADERS flag followed by an infinite stream of CONTINUATION frames. Because the client lacks limits on the incoming header-block accumulator, the client continuously consumes memory until an out-of-memory crash occurs.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 8 hours ago•CVE-2026-48596
2.1

CVE-2026-48596: Improper Neutralization of CRLF Sequences in Elixir Tesla Multipart HTTP Client

CVE-2026-48596 is an Improper Neutralization of CRLF Sequences in HTTP Headers (HTTP Request/Response Splitting, CWE-113) in the Elixir Tesla HTTP client. The flaw resides in how multipart content-type parameters are joined and serialized, enabling attackers to inject arbitrary headers or split HTTP requests when applications pass untrusted inputs to the parameters of multipart uploads.

Alon Barad
Alon Barad
5 views•6 min read
•about 9 hours ago•CVE-2026-48594
8.2

CVE-2026-48594: Decompression Bomb Denial of Service in Elixir Tesla HTTP Client

An improper handling of highly compressed data (decompression bomb) vulnerability exists in the Elixir Tesla HTTP client when utilizing response decompression middlewares. By serving highly compressed responses or stacked content-encoding headers, a malicious server can cause arbitrary heap exhaustion, leading to a denial of service (DoS) crash in the BEAM virtual machine.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 9 hours ago•CVE-2026-48595
8.2

CVE-2026-48595: Cross-Origin Credential Leakage in Elixir Tesla Client via Case-Sensitive Redirect Filter Bypass

A high-severity security vulnerability in Elixir's Tesla HTTP client library (CVE-2026-48595) allows unauthenticated remote attackers to harvest sensitive credentials, including Authorization headers and cookies. The flaw resides in the 'Tesla.Middleware.FollowRedirects' component, which performs case-sensitive lookups when stripping credentials during cross-origin redirects. Because HTTP headers are case-insensitive by RFC specifications, standard canonical casing (e.g., 'Authorization') bypasses the lowercase-only blocklist, leaking tokens to untrusted external redirect destinations.

Alon Barad
Alon Barad
6 views•5 min read