Skip to content
The Injection_
LIVE
LIVElast sweep next in--:--:--

[ RSS ][ JSON ][ llms.txt ]

greptimedb-mcp-server: a comment inside a string slips writes past read-only

A comment marker inside a SQL string literal made greptimedb-mcp-server's read-only gate approve write statements.

· GreptimeDB · Research by Dilanka Kaushal Hewage

GreptimeDB
MEDVulnerability

greptimedb-mcp-server 0.6.1 and earlier let stacked INSERT, DELETE and DROP statements pass the read-only gate by hiding a comment marker inside a SQL string. A prompt injection reaching the AI client was enough. Fixed in 0.6.2.

01What happened

Dilanka Kaushal Hewage, who reports as r3vpwnx, found that the read-only protection in greptimedb-mcp-server could be bypassed. GreptimeDB published the advisory and version 0.6.2 on 2026-12-02, and its proof of concept ran against GreptimeDB v1.3.1. GitHub rates the issue moderate with a CVSS 3.1 base score of 6.8, and the advisory records no CVE.

02How it works

The read-only gate strips comment markers from a query before scanning for forbidden keywords, without tracking string literals. A marker placed inside a string makes the gate discard the rest of the query, so it approves input that GreptimeDB then runs in full, including stacked write statements. The tools that expose this are execute_sql, execute_tql, query_range and explain_query. Version 0.6.2 tokenizes SQL with MySQL dialect rules and checks each statement against an allowlist of read statements.

03Who is affected

Versions 0.6.1 and earlier of greptimedb-mcp-server are affected, on GitHub and on PyPI. Exposure depends on the database account behind the server: an operator who pointed it at a read-write GreptimeDB user can have data inserted, deleted or dropped, while a genuinely read-only account limits the damage to what the gate was meant to prevent.

04What to do

Upgrade greptimedb-mcp-server to 0.6.2, and give the server a database user with read-only privileges, because the advisory stresses that the gate is not a security boundary on its own.

Sources 2 links, all fetched

  1. 1github.comGitHub Advisory
  2. 2github.comVersion 0.6.2 Notes