Joomla Privilege Escalation via SQL Injection
A second-order blind SQL injection in Joomla's backend template handling allowed an authenticated Manager to inject SQL via the admin_style parameter, which was stored and later used unsanitised in a query. This could let the attacker read arbitrary database data and escalate to full administrative privileges, leading to PHP code execution.
blog.ripstech.com
Published on blog.ripstech.com
Installations with the following requirements are affected by this vulnerability:
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 admin_style user parameter was saved without sanitisation and later concatenated directly into a SQL WHERE clause without proper escaping.
Impact
An attacker could read arbitrary database data, escalate to full administrative privileges, and take over the Joomla installation by executing arbitrary PHP code.
What the attacker needed
Joomla version 3.7.0 to 3.8.3; Authenticated Manager account
The fix
The vulnerability was fixed in Joomla 3.8.4; users should update to that version or later.
How it was found
- Log in to the Joomla backend with a Manager account.
- Intercept the request that saves user profile parameters.
- Change the admin_style parameter to a malicious value and save it.
- Load the dashboard to trigger the vulnerable query.
- Use error-based or timing-based techniques to extract data such as an administrator's session ID.
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 SQL injection is when user input is inserted into a database command without proper cleaning, letting an attacker change the command. Here, a low-privileged backend user could save a malicious value in their profile, and later that value was used in a database query, allowing them to steal data and eventually take over the site.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.