# CVE-2026-27876: RCE on Grafana via sqlExpressions

> Remote attackers can execute arbitrary code via SQL Expressions in Grafana when the feature toggle is enabled, requiring an upgrade to mitigate.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Mar 2026
- **Updated:** 27 Aug 2026
- **Also known as:** BIT-grafana-2026-27876, GHSA-736h-475m-xhjc, MINI-22rf-pxhg-g4cj, MINI-2f89-787w-6p44, MINI-2q37-qh9f-464m, MINI-3832-r8mm-7hh8, MINI-4xq3-hwwm-pjjh, MINI-626r-6vxf-c8vc, MINI-6cjx-xqwh-cr76, MINI-7g2j-mf7m-5h4r, MINI-8hcc-r926-jjqv, MINI-cfg4-whc6-pwv2, MINI-fhjx-3j9p-fjv5, MINI-j83c-fvj6-gmpm, MINI-rhp2-224h-vp86, MINI-vr7c-7cfv-f553, MINI-wx5r-px5x-879p, MINI-xrfr-2q4g-5wmv, UBUNTU-CVE-2026-27876

## What is CVE-2026-27876?

CVE-2026-27876 is a critical code injection vulnerability in Grafana Grafana, published on 27 Mar 2026. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

A chained attack via SQL Expressions and a Grafana Enterprise plugin can lead to a remote arbitrary code execution impact (RCE). This is enabled by a feature in Grafana (OSS), so all users are always recommended to update to avoid future attack vectors going this path.

Only instances with the sqlExpressions feature toggle enabled are vulnerable.

Only instances in the following version ranges are affected:

- 11.6.0 (inclusive) to 11.6.14 (exclusive): 11.6.14 has the fix. 11.5 and below are not affected.
- 12.0.0 (inclusive) to 12.1.10 (exclusive): 12.1.10 has the fix. 12.0 did not receive an update, as it is end-of-life.
- 12.2.0 (inclusive) to 12.2.8 (exclusive): 12.2.8 has the fix.
- 12.3.0 (inclusive) to 12.3.6 (exclusive): 12.3.6 has the fix.
- 12.4.0 (inclusive) to 12.4.2 (exclusive): 12.4.2 has the fix. 13.0.0 and above also have the fix: no v13 release is affected.

Weakness: CWE-89 (Improper Neutralization of Special Elements used in an SQL Command), CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2026-27876?

1 open source package ship an affected version, including grafana. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `grafana` | Bitnami | From 11.6.0 | 11.6.14, 12.1.10, 12.2.8, 12.3.6, 12.4.2 |

Products: Grafana Grafana.

## How do I fix CVE-2026-27876?

Upgrade grafana to a fixed version for your release line: 11.6.14, 12.1.10, 12.2.8 or 12.3.6.

## Is CVE-2026-27876 being exploited?

There is no known exploitation of CVE-2026-27876 in the wild and no public exploit code.

Public exploit code:

- CVE-2026-27876 (github_poc): https://github.com/0xredash/CVE-2026-27876
- Grafana SQL Expressions Arbitrary File Write to RCE (github_poc): https://github.com/atiilla/CVE-2026-27876

## Other vulnerabilities in Grafana Grafana

- [CVE-2021-43798](https://insights.sbomify.com/CVE-2021-43798/): Grafana Path Traversal (high 7.5, exploited in the wild)
- [CVE-2025-41115](https://insights.sbomify.com/CVE-2025-41115/): Incorrect privilege assignment (critical 10.0)
- [CVE-2022-39328](https://insights.sbomify.com/CVE-2022-39328/): Grafana vulnerable to race condition allowing privilege escalation (critical 9.8)
- [CVE-2022-28660](https://insights.sbomify.com/CVE-2022-28660/): Auth bypass in n/a (critical 9.8)
- [CVE-2022-26148](https://insights.sbomify.com/CVE-2022-26148/): Information disclosure in n/a (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-27876 and fix it if it is affected.

What it is: CVE-2026-27876 is a critical code injection vulnerability in Grafana Grafana, published on 27 Mar 2026. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-27876 in the wild and no public exploit code.

Affected packages and fixed versions:
- grafana (Bitnami): affected from 11.6.0; fixed in 11.6.14, 12.1.10, 12.2.8, 12.3.6, 12.4.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-27876/ (Markdown: https://insights.sbomify.com/CVE-2026-27876/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-27876
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-27876
- OSV: https://osv.dev/vulnerability/CVE-2026-27876

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-27876/
Summaries are generated and may contain mistakes; the official description above is the record.
