Horde Webmail – Remote Code Execution via Email
A PHP object injection flaw in Horde Webmail's contacts module allows an authenticated attacker to execute arbitrary code on the server by sending a crafted email that triggers a CSRF request. The attacker can also leak the victim's clear-text credentials.
blog.sonarsource.com
Published on blog.sonarsource.com
A webmail application enables organizations to host a centralized, browser-based email client for their members. Typically, users log into the webmail server with their email credentials, then the webmail server acts as a proxy to the organization's email server and allows authenticated users to view and send emails.
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
The Factory class did not check the type of the 'source' parameter, allowing an attacker to supply an array that was used as a configuration to instantiate an arbitrary driver, which then deserialized untrusted data leading to PHP object injection.
What the attacker needed
Victim uses Horde Webmail; victim opens the malicious email; attacker has an account on the Horde instance
The fix
No official patch is available; the vendor recommends migrating to an actively maintained webmail alternative.
How it was found
- Craft a malicious email containing an external image that exploits the vulnerability.
- Send the email to a victim who uses Horde Webmail.
- The victim opens the email, causing the external image to be loaded.
- The image request triggers a GET request to a vulnerable Horde endpoint, exploiting the lack of type checking.
- The attacker-controlled configuration instantiates an IMSP driver that deserializes malicious objects.
- Arbitrary code execution occurs on the Horde server, and the victim's clear-text credentials are leaked.
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.
Horde Webmail is a program that lets people read email in a browser. A bug in how it handles contact lists let an attacker send a special email that, when opened, made the server run the attacker's code. This could let the attacker take over the email server and steal passwords.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.