Get a free application, infrastructure and malware scan report - Scan Your Website Now

CVE-2024-9264 – Grafana’s SQL Expressions Vulnerability

Posted DateNovember 19, 2024
Posted Time 2   min Read

A critical vulnerability, CVE-2024-9264, has been discovered in Grafana, the open-source analytics and visualization platform widely used by organizations worldwide.

According to Netlas.io, over 100,000 Grafana instances may be vulnerable globally, with nearly 19,000 in the U.S. alone.

This vulnerability poses significant risks, enabling remote code execution (RCE), allowing attackers to execute arbitrary system commands and access sensitive files.

CVE-2024-9264 – Risk Analysis

Severity: Critical
CVSSv4.0 : Base Score: 9.4 Critical
Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

CVSSv3.1: Base Score: 8.8 High
Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Exploit available in public: Yes
Exploit complexity: High

CVE-2024-9264 is a command injection (CI) and local file inclusion (LFI) vulnerability identified in Grafana versions 11.0.x, 11.1.x, and 11.2.x. It allows attackers with Viewer permissions or higher to exploit SQL Expressions, a feature designed for post-processing query outputs.

The flaw arises from improper input sanitization when handling SQL queries sent to DuckDB via the Grafana API. With this, malicious actors can escape the intended SQL context, execute arbitrary commands, and even access restricted files.

How Does the Exploit Work?

For an attacker to successfully exploit CVE-2024-9264, the following conditions must be met:

  1. DuckDB binary installed: The DuckDB binary must be installed manually and added to Grafana’s PATH.
  2. User permissions: The attacker must have at least Viewer permissions to the Grafana instance.
  3. API access: The attacker can access the SQL Expressions feature via Grafana’s API, which was mistakenly enabled by default.

By crafting a malicious SQL query and leveraging the API, attackers can:

  • Execute commands on the host system (Command Injection).
  • Access files outside of intended directories (Local File Inclusion).

This vulnerability poses a threat to system confidentiality, integrity, and availability, enabling attackers to:

  • Access sensitive data
  • Manipulate data or system configurations
  • Cause service disruptions

Mitigation and Prevention

To safeguard against CVE-2024-9264, consider these steps:

  1. Upgrade Grafana: Immediately update to patched versions:
    • 11.0.5, 11.1.6, or 11.2.1 (security fix only).
    • 11.0.6, 11.1.7, or 11.2.2 (security fix + features).
  2. Restrict Permissions: Minimize the number of users with Viewer or higher permissions to reduce potential exposure.
  3. Audit PATH: Ensure the DuckDB binary is not in Grafana’s PATH unless explicitly required for secure operations.
  4. Use a Web Application Firewall (WAF): Deploy a WAF to monitor and block suspicious SQL commands and other unusual activities in network traffic.

Discover how WAFs prevent SQL injections—read our blog on Preventing SQL Injection Attacks.

AppTrana WAAP Protection

With AppTrana WAAP’s out-of-the-box coverage, our customers have been protected against this CVE from the day 0.

During PoC simulations for CVE-2024-8190, AppTrana WAAP effectively blocked the malicious request, as illustrated in the screenshots.

AppTrana WAAP blocking a CVE-2024-8190 attack attempt.

Stay tuned for more relevant and interesting security articles. Follow Indusface on FacebookTwitter, and LinkedIn.

AppTrana WAAP

Vivek Chanchal - Security Researcher
Vivek Chanchal

Vivek Chanchal is a security researcher at Indusface. He is a certified network security expert by Fortinet and ISCI. He is bug bounty hunter and a pentester and has reported vulnerabilities on multiple websites on platforms like Hackerone and Bugcrowd. He is also a CTF player on Hackthebox.

Share Article:

Join 51000+ Security Leaders

Get weekly tips on blocking ransomware, DDoS and bot attacks and Zero-day threats.

We're committed to your privacy. indusface uses the information you provide to us to contact you about our relevant content, products, and services. You may unsubscribe from these communications at any time. For more information, check out our Privacy Policy.

Related Posts

CVE-2024-47076: Critical Linux RCE in CUPS
RCE Zero Day Vulnerabilities in CUPS Put Linux Systems at Risk

CUPS RCE Vulnerabilities (CVE-2024-47076, CVE-2024-47177, CVE-2024-47175, CVE-2024-47176) put systems at risk of remote attacks through malicious printers.

Read More
CVE-2024-8517 - Unauthenticated Remote Code Execution in SPIP
CVE-2024-8517 – Unauthenticated Remote Code Execution in SPIP

A command injection flaw (CVE-2024-27348) in SPIP allows remote attacks without authentication. Learn mitigation steps & how AppTrana provides Day 0 protection.

Read More

AppTrana

Fully Managed SaaS-Based Web Application Security Solution

Get free access to Integrated Application Scanner, Web Application Firewall, DDoS & Bot Mitigation, and CDN for 14 days

Get Started for Free Request a Demo

Gartner

Indusface is the only cloud WAAP (WAF) vendor with 100% customer recommendation for 4 consecutive years.

A Customers’ Choice for 2024, 2023 and 2022 - Gartner® Peer Insights™

The reviews and ratings are in!