A recent new 0-day in Joomla discovered by Sucuri (Sucuri Blog) has drawn a lot of attention from the Joomla community, as well as attackers. Using knowledge gained from our recent research on Joomla (CVE-2015-7857, SpiderLabs Blog Post) and information detected by our honeypots, we would like to share some information on this new discovery.
The initial payload released by Sucuri (Sucuri Blog) demonstrates insecure processing of the "User-Agent" header that leads to remote code execution. The payload includes a JSON object. In order to understand what is happening behind the scenes, we explore what Joomla does incorrectly that leads to such a critical situation like code execution.
The vulnerability can be exploited through malicious manipulation of the User-Agent header. Joomla stores every User-Agent header that it receives in the website database. The attacker first sends an HTTP request with the malicious User-Agent provided. He then sends another request that causes Joomla to fetch the malicious User-Agent string from database and pass it through the unserialize function in the PHP programming language. This, in turn, causes the code execution to happen.
Detecting suspicious behavior, our area of protection
Trustwave SpiderLabs researchers detected the following exploitation of this vulnerability in one of our Honeypots. You can see the payload in the User-Agent field that was sent by an attacker in an attempt to trigger remote code execution.
We also detected use of the same vulnerability to perform an SQL injection. Here is a response from a vulnerable web server that shows the extracted data returned to the attacker.
Mitigation guidance for our WAF (Web Application Firewall) customers
- Trustwave WAF customers will be protected once CorSigs 4.40 is released. It is currently in release cycle. Please make sure you have automatic update feature ON.
- Customers may also write the following UDR (User Defined Rule) to detect this vulnerability.
- A commercial rule is available. Log in to your dashboard to update.
- A more generic rule for the community will also be available shortly.