Cve 2025 59689 Command Injection In Libraesva Esg
Libraesva ESG versions 4.5 through 5.5.x before 5.5.7 had a command injection flaw in how they sanitised compressed email attachments. An attacker could send a crafted archive by email and have shell commands run on the appliance under a non-privileged user.
CVE-2025–59689 is a medium-severity command injection vulnerability (CVSS 6.1) affecting Libraesva Email Security Gateway (ESG) versions 4.5 through 5.5.x prior to 5.5.7. Exploited in the wild by a state-sponsored threat actor, this flaw allows remote attackers to execute arbitrary shell commands via specially crafted…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the archive decompression and sanitisation logic did not handle every archive format, so embedded shell commands survived the scan and were executed.
Impact
An attacker could run commands on the appliance, which may allow lateral movement and privilege escalation; the text says exploitation was confirmed in the wild by a state actor.
What the attacker needed
Target runs vulnerable ESG 4.5 to 5.5.x; attacker can send email to the ESG; archive scanning is enabled
The fix
It was fixed in versions 5.0.31, 5.1.20, 5.2.31, 5.3.16, 5.4.8 and 5.5.7, and Libraesva deployed automated patches within 17 hours of detection.
How it was found
- Send an email carrying a compressed archive to the ESG.
- Include files in the archive that exploit the sanitisation flaw.
- The ESG runs the embedded shell commands while scanning.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
An email security gateway is a filter that checks incoming mail and attachments before they reach staff. Here, when it opened certain compressed files to scan them, it failed to clean out hidden commands, so those commands ran on the gateway itself. That let an outside sender run their own instructions on a machine inside the company network.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.