Sagredo qmail Remote Code Execution Vulnerability (CVE-2026-41113)
A remote code execution vulnerability exists in Sagredo qmail versions prior to 2026.04.07 due to the use of `popen` in the `notlshosts_auto` function within `qmail-remote.c`, potentially leading to OS command injection.
Sagredo qmail, a mail transfer agent (MTA), is vulnerable to a remote code execution (RCE) flaw, identified as CVE-2026-41113. Specifically, versions prior to 2026.04.07 are affected. The vulnerability lies in the notlshosts_auto function within the qmail-remote.c file, where the popen function is used without proper sanitization, potentially allowing an attacker to inject and execute arbitrary OS commands. This vulnerability could be exploited by a remote attacker without requiring authentication, making it a critical security concern for organizations utilizing the affected qmail versions. Defenders should prioritize patching and consider implementing mitigations to prevent potential exploitation.
Attack Chain
- An attacker sends an email to a target qmail server.
- The qmail server receives the email and processes the recipient address.
- During the delivery process,
qmail-remote.cis invoked to handle remote delivery. - The
notlshosts_autofunction is called withinqmail-remote.cto determine if TLS should be used for the connection. - The
notlshosts_autofunction executes thepopencommand with a crafted input string from the email, attempting to resolve hostnames. - The attacker injects malicious commands into the hostname string, which are then executed by
popenon the server. - The attacker gains arbitrary code execution on the qmail server.
- The attacker can then pivot to other systems within the network or exfiltrate sensitive data.
Impact
Successful exploitation of CVE-2026-41113 allows a remote attacker to execute arbitrary code on the vulnerable qmail server. This could lead to complete system compromise, data breaches, or denial-of-service conditions. Organizations using vulnerable versions of qmail are at risk of losing control of their email infrastructure and potentially exposing sensitive information. While the number of actively exploited instances is currently unknown, the high CVSS score (8.1) underscores the severity and potential for widespread impact.
Recommendation
- Upgrade to Sagredo qmail version 2026.04.07 or later to patch CVE-2026-41113 (reference: https://github.com/sagredo-dev/qmail/releases/tag/v2026.04.07).
- Implement network segmentation to limit the impact of a successful compromise on the qmail server.
- Monitor qmail server logs for suspicious activity, such as unusual process execution or network connections (enable process_creation and network_connection logging).
- Deploy the Sigma rule “Detect Suspicious Qmail Remote Execution via popen” to identify potential exploitation attempts.
Detection coverage 2
Detect Suspicious Qmail Remote Execution via popen
criticalDetects potential remote code execution attempts in Qmail by monitoring for process execution originating from qmail-remote invoking shell commands through popen.
Detect Qmail Spawning Network Connections to Unusual Ports
mediumDetects qmail processes initiating network connections to ports outside the standard SMTP range, which could indicate command and control or data exfiltration after a successful RCE.
Detection queries are kept inside the platform. Get full rules →
Indicators of compromise
1
| Type | Value |
|---|---|
| [email protected] |