Mailpit Unauthenticated Remote Memory Exhaustion DoS Vulnerability
Mailpit is vulnerable to an unauthenticated remote memory-exhaustion denial-of-service attack due to missing size limits on incoming SMTP DATA and HTTP requests, leading to unbounded memory and disk growth, potentially crashing the application.
Mailpit is susceptible to an unauthenticated remote denial-of-service (DoS) attack due to the absence of input size validation for SMTP DATA payloads and HTTP requests to the /api/v1/send endpoint. Specifically, the Server.MaxSize field in the Mailpit SMTP server, intended to control the maximum allowed DATA payload size, is never assigned a value, effectively disabling the size limit. Similarly, the HTTP endpoint lacks http.MaxBytesReader, resulting in unbounded memory allocation when processing requests. This vulnerability allows a network-reachable attacker to exhaust server memory by sending arbitrarily large messages via SMTP or HTTP, leading to an out-of-memory (OOM) condition and subsequent process termination. The default configuration binds listeners to [::]:1025 (SMTP) and [::]:8025 (HTTP) without authentication, exacerbating the risk. The issue affects Mailpit versions prior to 1.30.0.
Attack Chain
- Attacker establishes a connection to the Mailpit SMTP server on
[::]:1025or the HTTP server on[::]:8025. - For SMTP, the attacker sends
HELO,MAIL FROM, andRCPT TOcommands to initiate a mail transaction. - The attacker sends the
DATAcommand, signaling the start of the message body. - The attacker sends an arbitrarily large amount of data as the message body. Since the
MaxSizelimit is not enforced, the server buffers all incoming data in memory. - For HTTP, the attacker sends a
POSTrequest to/api/v1/sendwith a large JSON payload in the request body, without exceeding the server’s read timeout. - Mailpit attempts to process the excessively large message, leading to high memory consumption.
- Memory usage continues to increase as the attacker sends more data, exceeding available system resources.
- The Mailpit process is terminated by the operating system due to an out-of-memory (OOM) condition, resulting in a denial-of-service.
Impact
Successful exploitation of this vulnerability allows unauthenticated remote attackers to perform a denial-of-service attack against Mailpit installations. This can lead to service disruption, preventing legitimate users from utilizing the email testing functionality. Observed memory amplification reaches factors of 7-10x. The attack also fills disk space as oversized messages are persisted to the SQLite store.
Recommendation
- Upgrade Mailpit to version 1.30.0 or later to remediate CVE-2026-45713.
- Deploy the Sigma rule “Detect Mailpit Excessive SMTP Data” to identify potential exploitation attempts by monitoring for unusually large SMTP data transfers.
- Deploy the Sigma rule “Detect Mailpit Excessive HTTP API Send Payload” to identify potential exploitation attempts by monitoring for unusually large HTTP POST requests to the
/api/v1/sendendpoint. - Consider implementing network-level rate limiting on ports 1025 (SMTP) and 8025 (HTTP) to mitigate the impact of potential DoS attacks.
- Monitor system resource utilization (CPU, memory, disk I/O) on servers running Mailpit to detect anomalous behavior.
Detection coverage 3
Detect Mailpit Excessive SMTP Data
highDetects CVE-2026-45713 exploitation — Monitors for excessive data transfer during SMTP DATA command, indicating a potential memory exhaustion DoS attempt.
Detect Mailpit Excessive HTTP API Send Payload
highDetects CVE-2026-45713 exploitation — Monitors for excessively large HTTP POST requests to the /api/v1/send endpoint, indicating a potential memory exhaustion DoS attempt.
Detect Mailpit High Memory Usage
mediumDetects Mailpit using excessive memory, indicating a potential DoS attack.
Detection queries are available on the platform. Get full rules →