CVE-2025-59689
Medium · 6.1 CISA KEVCVSS
6.1
EPSS
1.9%
Published
Sep 19, 2025
CISA due date
Oct 20, 2025
Cloudanix analysis
A malicious email attachment can make the email security gateway run attacker commands, potentially letting attackers take control of the device before anyone opens the message.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Application
- Class
- Command Injection
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Libraesva Email Security Gateway versions 4.5 through affected 5.5.x releases contain a command injection flaw in the handling of compressed email attachments. A specially crafted archive or compressed attachment can cause the gateway’s attachment-processing logic to pass attacker-controlled content to an operating-system command interpreter, allowing arbitrary command execution on the appliance with the privileges of the mail-scanning service. Because exploitation is triggered through email processing, compromise may occur before a recipient opens or interacts with the message.
Why it matters to the business
A successful attack can give an external attacker control over an email security gateway, which is a high-value perimeter system that processes inbound and outbound mail. Compromise can lead to mail interception, credential theft, phishing enablement, malware delivery, data exposure, service disruption, and pivoting into adjacent infrastructure. This vulnerability is listed in CISA KEV, has reported active exploitation in the wild, and had a CISA remediation deadline of 2025-10-20, so unpatched systems should be treated as urgent exposure even though the CVSS score is moderate.
How an attack unfolds
An attacker crafts an email containing a compressed attachment designed to abuse the gateway’s archive inspection or decompression workflow. When Libraesva ESG receives and scans the message, the vulnerable component processes attacker-controlled archive metadata, filenames, or embedded content in a way that allows shell metacharacters or command syntax to reach the operating system. The injected command executes on the ESG appliance without requiring the recipient to open the email. After execution, an attacker may run reconnaissance commands, write files, establish outbound command-and-control, retrieve mail/security configuration, harvest credentials or tokens, modify mail-filtering behavior, or use the appliance as a foothold for further attacks. Public reporting indicates active exploitation campaigns against this vulnerability, so organizations should assume that internet-facing or mail-facing ESG appliances running vulnerable versions may have been probed or targeted.
How to fix it
Upgrade Libraesva ESG immediately to a fixed release for the deployed branch: ESG 5.0 to 5.0.31 or later, ESG 5.1 to 5.1.20 or later, ESG 5.2 to 5.2.31 or later, ESG 5.4 to 5.4.8 or later, and ESG 5.5 to 5.5.7 or later. ESG 4.5 and other unsupported or unlisted vulnerable branches should be upgraded to a supported fixed branch rather than left in place. If immediate upgrade is not possible, apply any vendor-provided hotfix, restrict administrative access to the appliance, reduce exposure of management interfaces, monitor and temporarily quarantine compressed attachments from untrusted senders where operationally acceptable, and place heightened monitoring on the appliance for unexpected command execution or outbound connections. Because this vulnerability is in KEV and actively exploited, remediation should include post-patch compromise assessment, not patching alone.
How to confirm the fix worked
Confirm the running ESG version from the appliance management interface, CLI, or vendor-supported inventory method and verify it is at or above the fixed version for its release branch. Send benign test emails with compressed attachments after patching to ensure attachment scanning still functions and no errors are produced. Review update history to confirm the security fix was applied successfully and that no rollback occurred. Validate that no vulnerable ESG 4.5 through pre-fixed 5.x appliances remain in asset inventory, vulnerability scanners, CMDB records, external attack-surface scans, or mail-routing documentation. For systems that were exposed before patching, perform forensic review of mail-processing logs, system logs, process execution history, file integrity, user/admin account changes, outbound network connections, and appliance configuration changes to determine whether exploitation occurred.
Typical attack path
- Identify an organization using Libraesva Email Security Gateway or send opportunistic mail to domains likely protected by ESG.
- Craft a compressed email attachment with archive metadata, filenames, or content that triggers command injection during scanning.
- Send the malicious email to a recipient whose mail path traverses the vulnerable ESG appliance.
- Allow the gateway to automatically decompress or inspect the attachment as part of normal email security processing.
- Execute attacker-supplied operating-system commands under the privileges of the ESG scanning process.
- Establish persistence or remote access, commonly through a dropped script, reverse shell, scheduled task, modified appliance configuration, or unauthorized administrative access.
- Collect sensitive mail, configuration, credentials, logs, or internal network information.
- Use the compromised gateway to relay malicious mail, hide phishing activity, disable protections, or pivot deeper into the environment.
How to detect it
Investigate whether the appliance processed suspicious compressed attachments before it was patched. Useful sources include Libraesva ESG mail-processing logs, quarantine logs, attachment-scanning logs, antivirus/archive extraction logs, system authentication logs, shell history where available, web/admin access logs, cron or scheduled-task records, package/update logs, file modification timelines, EDR telemetry if deployed on the appliance, and firewall/proxy/DNS logs for outbound traffic from the gateway. Look for inbound messages with compressed attachments immediately followed by archive extraction failures, scanner exceptions, suspicious command execution, new files in temporary or web-accessible paths, new administrative sessions, unexpected configuration changes, or outbound connections to unfamiliar hosts. Pay special attention to child processes such as shell interpreters, download tools, scripting runtimes, or networking utilities launched by mail-scanning or archive-processing services. Because exploitation can be email-triggered and non-interactive, absence of recipient clicks does not rule out compromise.
- sh -c
- /bin/sh -c
- bash -c
- /bin/bash -c
- /bin/nc
- nc -e
- ncat -e
- /usr/bin/wget
- /usr/bin/curl
- python -c
- python3 -c
- perl -e
- php -r
- mkfifo /tmp/
- /dev/tcp/
- chmod +x /tmp/
- crontab -e
- /etc/cron.d/
- /tmp/
- /var/tmp/
- $(whoami)
- `whoami`
- ;whoami
- |whoami
- && whoami
- $(id)
- `id`
- ;id
- |id
- && id
- compressed attachment
- archive extraction failed
- decompression failed
- scanner exception
- attachment scan error
What your security team should do
- Treat vulnerable Libraesva ESG appliances as high priority because the issue is CISA KEV-listed and actively exploited in the wild.
- Upgrade immediately to the fixed branch-specific versions: 5.0.31, 5.1.20, 5.2.31, 5.4.8, 5.5.7, or a later supported release.
- If the appliance was vulnerable while exposed to inbound email, initiate compromise assessment even if no alert has fired.
- Search historical email gateway logs for compressed attachments with suspicious archive member names, shell metacharacters, decompression errors, or scanner crashes around the time of receipt.
- Hunt for unexpected child processes spawned by mail-scanning, archive-handling, antivirus, or web service processes on the ESG appliance.
- Review outbound network connections from the appliance, especially unusual HTTP/S, DNS, SSH, or reverse-shell-like traffic to unfamiliar destinations.
- Audit ESG administrative users, API keys, mail-filtering rules, forwarding rules, quarantine settings, and update settings for unauthorized changes.
- Preserve relevant logs and disk artifacts before rebuilding or reimaging if compromise is suspected.
- Segment the appliance from internal systems where possible and restrict management access to trusted administrative networks.
- Create SIEM detections for archive-processing errors combined with command-execution behavior and for suspicious compressed-attachment patterns in inbound mail.
The record
Libraesva ESG 4.5 through 5.5.x before 5.5.7 allows command injection via a compressed e-mail attachment. For ESG 5.0 a fix has been released in 5.0.31. For ESG 5.1 a fix has been released in 5.1.20. For ESG 5.2 a fix has been released in 5.2.31. For ESG 5.4 a fix has been released in 5.4.8. For ESG 5.5. a fix has been released in 5.5.7.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|