This module exploits an authenticated command injection vulnerability in Grafana's experimental SQL Expressions feature. Affected Grafana releases are 11.0.0 through 11.0.6, 11.1.0 through 11.1.7, and 11.2.0 through 11.2.2. They pass attacker-controlled SQL expressions to DuckDB without sufficient sanitization. Successful command execution requires the duckdb binary to be available in the Grafana process PATH. This module uses DuckDB's shellfs community extension and Unix pipe syntax, so it is limited to Unix-like targets with shellfs available. The extension installation may download and cache files on the target.
Vulnerability
CVE-2024-9264
Grafana SQL Expressions allow for remote code execution
Vulnerability details
- Score
- 9.4
- Severity
- critical
CVSS 4.0 · GRAFANA
Vector string
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:HDescription
The SQL Expressions experimental feature of Grafana allows for the evaluation of `duckdb` queries containing user input. These queries are insufficiently sanitized before being passed to `duckdb`, leading to a command injection and local file inclusion vulnerability. Any user with the VIEWER or higher permission is capable of executing this attack. The `duckdb` binary must be present in Grafana's $PATH for this attack to function; by default, this binary is not installed in Grafana distributions.
CVE ProgramExploit source choices
10 sourcesExploit for Grafana arbitrary file-read and RCE (CVE-2024-9264)
Grafana RCE exploit (CVE-2024-9264)
File Read Proof of Concept for CVE-2024-9264
A go implementation for CVE-2024-9264 which effect grafana versions 11.0.x, 11.1.x, and 11.2.x.
Authenticated RCE in Grafana (v11.0) via SQL Expressions - PoC Exploit
12442rf/poc source repository
RCE exploit via SQL Expressions
Grafana SQL Expressions → DuckDB LFI (CVE-2024-9264)
An high-performance security scanner designed for comprehensive vulnerability assessment of monitoring and logging infrastructure stacks with concurrent processing and extensive CVE coverage.