CVE-2024–42327: Exploiting a Critical Zabbix SQL Injection in P
A SQL injection in Zabbix's user.get API via the selectRole parameter allowed extraction of arbitrary database data, including admin session tokens, leading to privilege escalation and potential remote code execution through system.run items. The author demonstrated the vulnerability in a production environment but could not achieve a reverse shell due to network restrictions.
When I set out to assess the security of a client’s Zabbix monitoring infrastructure, I didn’t expect to find one of the most critical vulnerabilities of 2024. CVE-2024–42327, a SQL injection vulnerability with a CVSS score of 9.9, turned out to be present in their production environment — and I was about to see…
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 selectRole parameter was not properly sanitised before being used in a SQL query, allowing injection.
Impact
An attacker with low privileges could extract sensitive data, escalate to Super Admin, and potentially achieve remote code execution, though network restrictions may block reverse shells.
What the attacker needed
API access with any user account; Zabbix version 6.0.0-6.0.32, 6.4.0-6.4.17, or 7.0.0-7.0.1
The fix
The vulnerability was fixed in Zabbix 7.0.2rc1 by properly sanitizing the selectRole parameter.
How it was found
- Send an API request to check the Zabbix version.
- Authenticate to the API using user.login to obtain a token.
- Send a user.get request with a crafted selectRole parameter containing SQL injection.
- Extract data from the database, including admin session tokens.
- Use the stolen admin session to create an item that executes system commands via system.run.
- Attempt to establish a reverse shell (failed due to network restrictions).
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.
Zabbix is a tool that monitors computers and networks. A SQL injection is when an attacker sneaks database commands into a normal request, tricking the server into running them. Here, a user could send a special request to the Zabbix API that made the database reveal secret information, like other users' login sessions, which could then be used to take over the system.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.