CVE-2025-61600 Overview
CVE-2025-61600 is an unbounded memory allocation vulnerability affecting Stalwart, a mail and collaboration server. The vulnerability exists in the IMAP protocol parser, where the CommandParser implementation fails to enforce size limits on its dynamic buffer in several parsing state handlers. This oversight allows remote attackers to exhaust server memory by sending specially crafted IMAP commands, potentially triggering the system's out-of-memory (OOM) killer and causing a complete denial of service.
Critical Impact
Remote attackers can exploit this vulnerability to cause complete service disruption by exhausting server memory through malicious IMAP requests, requiring no authentication or user interaction.
Affected Products
- Stalwart Mail Server versions 0.13.3 and below
Discovery Timeline
- 2025-10-02 - CVE-2025-61600 published to NVD
- 2026-04-15 - Last updated in NVD database
Technical Details for CVE-2025-61600
Vulnerability Analysis
This vulnerability is classified as CWE-400 (Uncontrolled Resource Consumption). The flaw resides in the IMAP protocol parser's CommandParser implementation, which is responsible for parsing incoming IMAP commands from clients. While the parser correctly enforces size limits on its dynamic buffer in most parsing states, several state handlers omit these critical validation checks.
The vulnerability enables remote attackers to craft malicious IMAP requests that exploit these unvalidated parsing states, causing the server to allocate unbounded amounts of memory. When memory resources are exhausted, the operating system's OOM killer may terminate the Stalwart process or other critical system services, resulting in denial of service.
Root Cause
The root cause stems from inconsistent input validation across the CommandParser state machine. While most parsing states properly check and limit the size of the dynamic buffer before allocation, certain state handlers bypass these checks entirely. This inconsistency creates an exploitable condition where attackers can target the vulnerable states to trigger excessive memory allocation without proper bounds checking.
Attack Vector
The attack can be executed remotely over the network without requiring authentication or user interaction. An attacker connects to the IMAP service (typically on port 143 or 993 for IMAPS) and sends specially crafted IMAP commands that exploit the vulnerable parsing states.
The malicious commands cause the parser to allocate increasingly large amounts of memory without bound. As memory consumption grows, system performance degrades until the OOM killer intervenes or the service becomes unresponsive. The attack complexity is low, making it accessible to attackers with basic knowledge of the IMAP protocol.
Detection Methods for CVE-2025-61600
Indicators of Compromise
- Abnormally high memory consumption by the Stalwart mail server process
- Sudden spikes in IMAP connection requests from single or multiple IP addresses
- OOM killer events in system logs targeting the Stalwart process
- Service interruptions or restarts correlating with IMAP traffic anomalies
Detection Strategies
- Monitor system memory usage for the Stalwart process and alert on unusual growth patterns
- Implement IMAP protocol inspection to identify malformed or oversized commands
- Analyze connection logs for repeated connection attempts from suspicious sources
- Deploy network intrusion detection rules targeting IMAP protocol anomalies
Monitoring Recommendations
- Configure memory usage thresholds and alerts for the Stalwart service
- Enable detailed IMAP command logging to capture potential exploitation attempts
- Monitor system logs for OOM killer activity affecting mail server processes
- Track connection metrics including rate, duration, and command patterns per client
How to Mitigate CVE-2025-61600
Immediate Actions Required
- Upgrade Stalwart to version 0.13.4 or later immediately
- Implement rate limiting on IMAP connections at the network perimeter
- Configure connection monitoring to detect and block suspicious activity
- Review current memory limits and resource allocation for the Stalwart service
Patch Information
The vulnerability has been fixed in Stalwart version 0.13.4. The fix implements proper bounds checking across all CommandParser state handlers to prevent unbounded memory allocation. Organizations should apply this update as soon as possible to eliminate the vulnerability.
For detailed information about the fix, refer to:
Workarounds
- Implement rate limiting at the network level to restrict IMAP connection rates per source IP
- Deploy connection monitoring and automated blocking for clients exhibiting suspicious behavior
- Configure firewall rules to limit access to IMAP services to trusted networks where possible
- Note: Network-level mitigations do not provide complete protection; upgrading to 0.13.4 is the recommended solution
# Example: Rate limiting IMAP connections with iptables
# Limit new IMAP connections to 10 per minute per source IP
iptables -A INPUT -p tcp --dport 143 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 143 -m state --state NEW -m recent --update --seconds 60 --hitcount 10 -j DROP
# For IMAPS (port 993)
iptables -A INPUT -p tcp --dport 993 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 993 -m state --state NEW -m recent --update --seconds 60 --hitcount 10 -j DROP
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

