What happened
The shared library that powers MSSQL MCP servers interpolated caller-controlled identifiers and the free-form whereClause into T-SQL batches, parameterizing only data values. The fix introduces sqlIdentifier.ts (allowlist + bracket-quoting) and whereFilter.ts (operator allowlist, always-bound values) and applies them across update_data, delete_data, insert_data, execute_transaction, create_table, create_index and drop_table. Count/preview queries also ran before the confirmation gate.
Why it matters
MSSQL MCP servers let LLM agents issue database operations. Because injection fires on unconfirmed first calls and is reachable by prompt-injected agents, a single malicious action can escalate to arbitrary SQL execution (and via xp_cmdshell, code execution) against the database the agent is trusted to query.
Attack vector
Tool arguments (table/column/index identifiers and the free-form whereClause) are string-interpolated into T-SQL passed to Request.query() while only data values are parameterized, so a caller — or an LLM steered by prompt injection — can inject stacked statements, DDL, or conditional xp_cmdshell on reachable SQL Server instances.
Affected systems
mssql-mcp-core below 0.6.0 (mssql-mcp server below 0.6.0, reader/writer below 0.5.0)
Mitigation
Upgrade to mssql-mcp-core/server 0.6.0 (reader/writer 0.5.0), which add an identifier allowlist/bracket-quoting and structured parameterized filters; note the breaking change to a structured filters array.