CVE-2024-9264 — grafana
Fix: grafana/grafana#81666CVE-2024-9264 is a Code Injection vulnerability in github.com/grafana/grafana. 7 public exploit references exist, so weaponization risk is real. A fix is available for github.com/grafana/grafana — see the affected versions and patch details below.
Grafana SQL Expressions allow for remote code execution
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2024-9264.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
github.com/grafana/grafana🐹github.com/grafana/grafana🐹github.com/grafana/grafanaReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/grafana/grafana | ≥ 11.0.0&&< 11.0.6+security-01 | 11.0.6+security-01go get github.com/grafana/grafana@v11.0.6+security-01 |
| 🐹Go | github.com/grafana/grafana | ≥ 11.1.0&&< 11.1.7+security-01 | 11.1.7+security-01go get github.com/grafana/grafana@v11.1.7+security-01 |
| 🐹Go | github.com/grafana/grafana | ≥ 11.2.0&&< 11.2.2+security-01 | 11.2.2+security-01go get github.com/grafana/grafana@v11.2.2+security-01 |
Affected Products
grafanagrafanaResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/grafana/grafana, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/grafana/grafana to 11.0.6+security-01 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-9264 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
How to detect CVE-2024-9264
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id cve-2024-9264 -u https://target- Template
- Grafana Post-Auth DuckDB - SQL Injection To File Read
- Severity
- critical
- Impact
- Authenticated users with VIEWER or higher permissions can exploit SQL injection to read local files and execute commands through duckdb queries when the duckdb binary is present, potentially exposing sensitive configuration files and credentials.
- Remediation
- Apply the vendor-supplied patch or upgrade to a non-vulnerable version.
Template by ProjectDiscovery nuclei-templates (princechaddha), MIT licensed. View the full template. Scan only systems you are authorised to test.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This vulnerability is classified as critical instead of important because it allows for command injection and local file inclusion, potentially leading to arbitrary code execution or unauthorized access to sensitive files. The exploit can be carried out by any user with VIEWER or higher permissions, significantly…
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.Source: Red Hat security advisory for CVE-2024-9264 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2024-9264 in your dependencies?
Find it across Go, including transitive dependencies.