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.
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.
How to check
- Check whether you run SurrealDB 3.1.x–3.x with its MCP server enabled for an AI agent or MCP client.
- Review the database user/role the MCP server connects with; that is what an injected statement runs as.
- Look in query logs for MCP tool calls whose table or field names contain backslashes or backticks.
How to fix
- Upgrade SurrealDB to 4.0.0 or later.
- Until then, disable the MCP server or connect it with a least-privilege, namespace-scoped user, and don't let it process untrusted content.
- 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 Sources
- criticalMalicious npm package @guicai777/mcp-doctor posed as an MCP diagnostic tool and dropped a hidden Windows executable, with a README telling users to run mshta (MAL-2026-20295)
- criticalCVE-2026-77359: Jupyter MCP Server's /api/connect and /api/stop routes skipped the token and Origin checks, so a website or network caller could repoint it to an attacker's Jupyter backend (fixed 1.0.3)
- criticalMalicious npm packages posing as AI SDKs and MCP servers: character-ai-sdk, char-ai-sdk, @mibbp/agent-observer, mrnima-openai-chatgpt-bot and @fdcasj_dfew/md-doc-mcp
- criticalCVE-2026-76807: Doist's official Todoist MCP HTTP server let any website use DNS rebinding to read, create and delete your Todoist data (fixed 10.3.3)