← All advisories
CVE-2026-134293highCode execution2026-11-21

CVE-2026-134293: SurrealDB's built-in MCP server let an escaped backtick in a tool argument break out of a quoted identifier and run arbitrary SurrealQL (fixed 4.0.0)

SurrealDB 3.1.0 and later ship a Model Context Protocol (MCP) server so AI agents can work with the database through tools. Its identifier validator (consume_backtick_ident and validate_identifier in surrealdb/mcp/src/tools/mod.rs) treated the first backtick as the end of a quoted identifier, while the SurrealQL parser honours \` as an escaped backtick. An MCP tool argument containing an escaped backtick therefore broke out of the identifier and the rest ran as raw SurrealQL, bypassing the tool's argument constraints. Anyone who can steer the agent's tool arguments, including through prompt injection, could run arbitrary statements with the MCP server's database rights. Fixed in 4.0.0.

01.

What it is

Affected files: surrealdb/mcp/src/tools/mod.rs (consume_backtick_ident, validate_identifier) and surrealdb/mcp/src/tools/crud.rs. Queries were built by string interpolation of identifiers.

The fix (commit ec41ae8f15, 'fix(mcp): MCP tool identifier validation permits statement injection via escaped backticks') validates MCP tool identifiers so an escaped backtick can no longer end the identifier.

Affected: SurrealDB 3.1.0 up to (not including) 4.0.0, per NVD. Reported by ARSB.

Timeline: SurrealDB v4.0.0 was released on 3 November 2026, GitHub published the advisory the same day, and NVD published the CVE (CNA VulnCheck) on 21 November 2026.

02.

How to check

  1. Check whether you run SurrealDB 3.1.x–3.x with its MCP server enabled for an AI agent or MCP client.
  2. Review the database user/role the MCP server connects with; that is what an injected statement runs as.
  3. Look in query logs for MCP tool calls whose table or field names contain backslashes or backticks.
03.

How to fix

  1. Upgrade SurrealDB to 4.0.0 or later.
  2. Until then, disable the MCP server or connect it with a least-privilege, namespace-scoped user, and don't let it process untrusted content.
  3. Treat MCP tool arguments as attacker-controlled: an agent reading untrusted data can be prompted to send any identifier.
surreal version
# or for containers
docker ps --format '{{.Image}}' | grep -i surrealdb
04.

Sources

More advisories for this tool
The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.