<div dir="ltr"><p>Original:<a href="https://www.scworld.com/news/grafana-critical-vulnerability-risks-remote-code-execution">https://www.scworld.com/news/grafana-critical-vulnerability-risks-remote-code-execution</a></p><p></p><p>Grafana, an open-source data analytics and visualization platform, was found to have a critical vulnerability that could lead to remote code execution.</p><p>The flaw, tracked as <a href="https://nvd.nist.gov/vuln/detail/CVE-2024-9264" target="_blank" rel="noreferrer noopener">CVE-2024-9264</a>, which has a CVSS v4 score of 9.4, was introduced in Grafana version 11 released in May 2024, <a href="https://grafana.com/blog/2024/10/17/grafana-security-release-critical-severity-fix-for-cve-2024-9264/" target="_blank" rel="noreferrer noopener">Grafana Labs disclosed Thursday</a>. The vulnerability stems from an experimental feature called SQL Expressions, which allows for post-processing of data source query outputs via SQL queries to the open-source relational database management system DuckDB.</p><p>Grafana’s SQL Expressions feature does not properly sanitize these SQL queries to the DuckDB command line interface (CLI), which can allow for both command injection and local file inclusion via a malicious query. This vulnerability could be exploited by any user with a “viewer” permission or higher, <a href="https://grafana.com/security/security-advisories/cve-2024-9264/" target="_blank" rel="noreferrer noopener">according to Grafana Labs</a>.</p><p>SQL Expression is enabled by default for the Grafana API, however, Grafana Lab noted that the vulnerability is only exploitable if the DuckDB binary is installed and included in the PATH of the Grafana process’ environment, which is not the default.</p><div class="gmail-Placeholder_base__bMucx gmail-Placeholder_boxInline__i8JCj gmail-Placeholder_refresh__cppzz gmail-Placeholder_withDisclaimer__SC2O5 gmail-slot_wrapper__JFKwH gmail-mb-3 gmail-pb-0 gmail-d-flex gmail-flex-column gmail-clear-both gmail-dfp-slot gmail-ad gmail-align-items-center"><div class="gmail-"></div></div><div class="gmail-GuttenbergBlockFactory_wrapper__AcvAp"><div class="gmail-Placeholder_base__bMucx gmail-Placeholder_boxInline__i8JCj gmail-Placeholder_refresh__cppzz gmail-Placeholder_withDisclaimer__SC2O5 gmail-slot_wrapper__JFKwH gmail-mb-3 gmail-pb-0 gmail-d-flex gmail-flex-column gmail-clear-both gmail-dfp-slot gmail-ad gmail-align-items-center"><div class="gmail-"><div class="gmail-mx-auto" id="gmail-:Ramcr6km:"><div id="gmail-google_ads_iframe_21883553441/Box_0__container__" style="border:0pt;margin:auto;text-align:center"></div></div></div></div><p>SC Media contacted Grafana and asked how many users were believed to be using vulnerable and exploitable versions of the platform, and did not receive a response. The open-source intelligence (OSINT) platform Netlas.io <a href="https://x.com/Netlas_io/status/1847183420599730198" target="_blank" rel="noreferrer noopener">reported</a> that more than 100,000 Grafana instances were “probably vulnerable to CVE-2024-9264” Friday, including nearly 19,000 in the United States.</p><h2>How to patch Grafana CVE-2024-9264</h2><p>Grafana released six new versions that resolve the critical vulnerability, including three downloads that only contain the security fix and three that patch the flaw while also upgrading users to the most recent Grafana versions.</p><p>Users who want to install the patch without installing the latest version release can download versions <a href="https://grafana.com/grafana/download/11.0.5+security-01" target="_blank" rel="noreferrer noopener">11.0.5+security-01</a>, <a href="https://grafana.com/grafana/download/11.1.6+security-01" target="_blank" rel="noreferrer noopener">11.1.6+security-01</a> or <a href="https://grafana.com/grafana/download/11.2.1+security-01" target="_blank" rel="noreferrer noopener">11.2.1+security-01</a>.</p><p>Users can also simultaneously patch and upgrade to the most recent versions by installing release <a href="https://grafana.com/grafana/download/11.0.6+security-01" target="_blank" rel="noreferrer noopener">11.0.6+security-01</a>, <a href="https://grafana.com/grafana/download/11.1.7+security-01" target="_blank" rel="noreferrer noopener">11.1.7+security-01</a> or <a href="http://Download%20Grafana%20v11.2.2+security-01" target="_blank" rel="noreferrer noopener">11.2.2+security-01</a>.  </p><p>While Grafana Labs strongly recommended downloading the security patch “as soon as possible,” users can also mitigate the vulnerability by removing the DuckDB binary from their system or the PATH where it is accessible to Grafana. SQL Expressions was the only Grafana feature that utilized DuckDB, the company said.</p><p>The vulnerability was first discovered by Grafana staff on Sept. 26, 2024, and Grafana began rolling out the security patch across all channels for Grafana Cloud the following day, according to a timeline published by Grafana Labs.</p><p>By Oct. 1, the patch was completed across all Grafana Cloud instances, and the patch for the Grafana Open-Source Software (OSS) and Grafana Enterprise began to be privately released on Oct. 3. The patch completely removes the SQL Expressions functionality.</p></div><div></div><div class="gmail-px-3 gmail-px-md-4 gmail-py-3 gmail-py-md-4 gmail-mt-0 gmail-mb-0 gmail-CtaCard_newCtaCardBody__3mpoG gmail-text-center gmail-cta-card"><h3 class="gmail-fs-4 gmail-shallow-fs-4 gmail-BlockWrapper_blockHeader__7q7cS"><br></h3></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>===</div><div>Computer Security Incident Response Team - CSIRT</div><div>Universidade Estadual de Campinas - Unicamp</div><div>Centro de Computacao - CCUEC</div><div>GnuPG Public Key: <a href="http://www.security.unicamp.br/security.asc" target="_blank">http://www.security.unicamp.br/security.asc</a> [^]</div><div>Contato: +55 19 3521-2289 ou INOC-DBA: 1251*830</div></div></div></div></div>