Skip to content
RCE Write-up Advanced

Vulnerability Details: Joomla Remote Code Execution

Joomla stored the client's user-agent inside the PHP session, and because PHP's session encoding uses a different format from normal serialisation, an attacker could inject extra serialised data into the session. A MySQL collation quirk then truncated the trailing data, leaving a crafted serialised object that led to object injection and remote code execution.

blog.sucuri.net

Published on blog.sucuri.net

The Joomla! team released a new version of Joomla! CMS yesterday to patch a serious and easy to exploit remote code execution vulnerability that affected pretty much all versions of the platform up to 3.4.5.

Marc-Alexandre Montpas, on blog.sucuri.net

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 user-agent was written into the session without sanitisation, and PHP's session encoding plus MySQL's utf8_general_ci truncation allowed an injected serialised object to survive.

Impact

An attacker could achieve remote code execution on unpatched Joomla sites, and the flaw was already being exploited in the wild two days before disclosure.

What the attacker needed

Unpatched Joomla up to 3.4.5; ability to send a crafted user-agent

How it was found

  1. Send a request whose user-agent contains a crafted serialised payload.
  2. Joomla stores that user-agent value in the session record.
  3. The database truncates the data at an unsupported character, removing the trailing bytes.
  4. The resulting session decodes into an attacker-controlled serialised object.
  5. The object injection leads to code execution on the site.

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.

A session is how a website remembers who you are between page loads; Joomla saved part of your browser's identifying text (the user-agent) into that session. PHP writes sessions in a loose text format, so clever characters in that text could trick the site into reading extra data as if it were its own. That let an attacker plant a malicious object that the site later executed as code.

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.