CVE-2026-27876: Remote Code Execution in Grafana SQL Expressions via Arbitrary File Write Chain
- Vendor
- Grafana Labs
CVE-2026-27876 is a critical Grafana vulnerability in the SQL Expressions feature that can be used as part of a chained attack with a Grafana Enterprise plugin to achieve remote arbitrary code execution. According to the provided content, the flaw is enabled by Grafana OSS functionality and affects only instances where the sqlExpressions feature toggle is enabled. The issue allows an attacker with sufficient privileges to write arbitrary files to the Grafana server filesystem. The provided context further states that this arbitrary file write can be used to overwrite a Sqlyze driver or manipulate an AWS data source configuration file, and then be chained into full RCE, including unauthorized SSH access to the underlying host in some scenarios. Affected versions are 11.6.0 through 11.6.13, 12.0.0 through 12.1.9, 12.2.0 through 12.2.7, 12.3.0 through 12.3.5, and 12.4.0 through 12.4.1.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation can allow an attacker to write arbitrary files on the Grafana server and, when chained with a Grafana Enterprise plugin attack path, achieve remote arbitrary code execution on the underlying host. The supplied context indicates high impact across confidentiality, integrity, and availability, and notes that exploitation may enable full host compromise outcomes such as unauthorized SSH access. This can result in execution of attacker-controlled code, tampering with Grafana components or plugin-related files, theft of sensitive data accessible from the host, service disruption, and broader post-exploitation activity from the compromised server.
Mitigation
If you can’t patch tonight, do this now.
As a temporary mitigation, disable the sqlExpressions feature toggle, since only instances with that feature enabled are vulnerable. Restrict query execution privileges to the minimum necessary, because the provided context states exploitation requires Viewer permissions or higher to execute data source queries. Where possible, reduce exposure of Grafana instances and limit access to Enterprise plugins and sensitive filesystem paths until patched versions are deployed.
Remediation
Patch, then assume compromise.
Upgrade Grafana to a fixed release. The provided content identifies the patched versions as 11.6.14, 12.1.10, 12.2.8, 12.3.6, 12.4.2, and all 13.0.0 and later releases. Version 12.0 is end-of-life and did not receive an update, so affected 12.0 deployments should be upgraded to a supported fixed branch. Grafana recommends updating all users to avoid current and future attack paths using this mechanism.
Exploits
1 exploit validated by Mallory's analysis. Hidden: 1 rejected by Mallory's analysis as not a working exploit.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2026-27876 exploited in the wild?
- As of Nov 3, 2026, Mallory has no reports of CVE-2026-27876 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2026-27876?
- Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2026-27876, the earliest disclosed Sep 5, 2026.
- Is there a patch for CVE-2026-27876?
- Upgrade Grafana to a fixed release. The provided content identifies the patched versions as 11.6.14, 12.1.10, 12.2.8, 12.3.6, 12.4.2, and all 13.0.0 and later releases.
- What products are affected by CVE-2026-27876?
- Grafana Labs Grafana.
- How severe is CVE-2026-27876?
- CVE-2026-27876 has a CVSS v3.1 score of 9.1 (Critical) and an EPSS score of 2.0% (81st percentile) as of Nov 3, 2026.
Recent activity
18 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.