Skip to content
XSS Write-up Intermediate

Horde Webmail 5.2.22 - Account Takeover via Email

A stored cross-site scripting vulnerability in Horde Webmail allows an attacker to execute JavaScript when a victim views a crafted OpenOffice document attachment, giving the attacker full access to the victim's email account. This could lead to stealing all emails and, if the victim is an administrator, taking over the entire webmail server.

blog.sonarsource.com

Published on blog.sonarsource.com

Horde Webmail is a free, enterprise-ready, and browser-based communication suite developed by the Horde project. It is a popular webmail solution for universities and government agencies to exchange sensitive email messages on a daily basis.

The author, on blog.sonarsource.com

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 XSLT stylesheet used to convert OpenOffice documents to XHTML allows the creation of arbitrary HTML elements, including script tags, and the resulting HTML is not sanitised before being returned to the user.

Impact

An attacker could steal all emails the victim has sent and received, and if the victim is an administrator, could execute arbitrary system commands and take over the entire webmail server.

What the attacker needed

Victim uses Horde Webmail; victim opens the malicious attachment; attacker can send email to victim

The fix

There is no official patch; administrators should disable the rendering of OpenOffice attachments by setting 'disable' => true in the mime_drivers.php configuration file.

How it was found

  1. Craft an OpenOffice document containing a draw:object element with a math:math child and a math:semantics child that includes a script tag.
  2. Send the document as an email attachment to the victim.
  3. The victim opens the attachment in Horde Webmail, triggering the preview.
  4. The XSLT transformation produces HTML containing the script tag, which executes in the victim's browser.

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.

This is a stored cross-site scripting (XSS) bug. When Horde converts an OpenOffice document to HTML for preview, it fails to sanitise the output, so an attacker can include a script that runs in the victim's browser when they open the attachment. That script can then read the victim's emails and perform actions as them.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.