Skip to content
RCE Write-up Intermediate

[CVE-2020-8518] Horde Groupware Webmail Edition 5.2.22 — RCE in CSV data import

The CSV import feature in Horde Groupware Webmail Edition uses create_function with insufficient sanitisation of the quote parameter, allowing an authenticated user to inject arbitrary PHP code. This leads to remote code execution as the web server user.

cardaci.xyz

Published on cardaci.xyz

The Horde project comprises several standalone applications and libraries, the Horde Groupware Webmail Edition suite (tested version 5.2.22) bundles several of them by default, among those, Data is a library used to manage data import/export in several formats, e.g., CSV, iCalendar, vCard, etc.

The author, on cardaci.xyz

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 code uses create_function with a user-controlled string that is insufficiently escaped, allowing an attacker to break out of the intended string and inject PHP code.

Impact

An authenticated user can execute arbitrary PHP and shell commands as the web server user, leading to full compromise of the server.

What the attacker needed

A valid user account; access to the Mnemo data import page

The fix

The issue was fixed in version 2.1.5 by replacing create_function with a lambda function.

How it was found

  1. Log into Horde.
  2. Navigate to the Mnemo data import page.
  3. Select any non-empty file to import and click Next.
  4. In the quote character field, enter the payload.
  5. Click Next; the command output is returned.

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.

The application builds a piece of PHP code using a setting from the user (the quote character) without properly escaping it. A logged-in user can craft that setting so that the code does something else, like running a system command. This lets them run commands on the server with the web server's permissions.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.