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.
The attack consists of chaining the SQL Expressions mechanism available in Grafana OSS with functionality provided by the Grafana Enterprise plugin. The vulnerability classified as CWE-94 (code injection) indicates that inadequately controlled user input reaches the code execution engine. A necessary condition is enabling the sqlExpressions feature switch on the vulnerable instance. An attacker with administrative privileges can remotely execute arbitrary code on the server.
Successful exploitation of the vulnerability gives the attacker full control over the server — data reading and modification is possible (C:H, I:H) as well as disruption of service availability (A:H). The scope of the attack extends beyond the vulnerable component (S:C), which increases the risk of further lateral movement in the infrastructure.
Grafana should be updated to a patched version: 11.6.14, 12.1.10, 12.2.8, 12.3.6, or 12.4.2. Versions 13.0.0 and higher are not vulnerable. If immediate update is not possible, the sqlExpressions feature switch should be disabled. The vendor recommends updating to all users regardless of configuration to eliminate potential future attack vectors.
Grafana (OSS and Enterprise) with the sqlExpressions feature switch enabled in the following version ranges: 11.6.0–11.6.13, 12.0.0–12.1.9, 12.2.0–12.2.7, 12.3.0–12.3.5, 12.4.0–12.4.1. Versions 11.5 and older are not vulnerable. Version 12.0 is end-of-life and did not receive a patch.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:HGrafana
APPGrafana< 11.6.011.6.14 – 12.0.0 (excl.)12.1.10 – 12.2.0 (excl.)12.2.8 – 12.3.0 (excl.)12.3.6 – 12.4.0 (excl.)
Related vulnerabilities
Grafana – ominięcie uwierzytelnienia i nieuprawniony dostęp do snapshotów
Grafana Enterprise: privilege escalation przez SCIM provisioning (LPE)
Grafana: command injection i local file inclusion przez SQL Expressions (duckdb)
Grafana: Pominięcie uwierzytelniania przez manipulację emailem w Azure AD OAuth
Race condition w Grafana umożliwia nieautoryzowany dostęp do endpointów administracyjnych