CVE-2026-63129: mssql-mcp-core: SQL injection in mssql-mcp write tools via unparameterized table names and WHERE clauses

Published Nov 18, 2026
·
Updated

mssql-mcp-core is the shared library that powers MSSQL MCP servers. Prior to core and server 0.6.0 and reader and writer 0.5.0, multiple database tools interpolate caller-controlled identifiers and predicates into T-SQL batches passed to Request.query() while parameterizing only data values. updatedata, deletedata, insertdata, executetransaction, createtable, createindex, and droptable accept unsafe tableName, column, index, schema, or free-form whereClause input, while reader-tier listdatabases interpolates stateFilter without runtime allowlist enforcement. Row-count and preview queries execute before confirmUpdate or confirmDelete, allowing malicious arguments to bypass confirmation and maxRows controls and execute stacked DDL or DML, read or destroy data, and potentially run operating-system commands when the SQL login is privileged and xpcmdshell is enabled. This issue is fixed in core and server version 0.6.0 and reader and writer version 0.5.0.

Other sources

Several tools in mssql-mcp-core built T-SQL by string-interpolating caller-supplied identifiers and predicates directly into the statement passed to the node-mssql Request.query() batch API. Only data values were parameterized.

Affected tools and inputs: - updatedata, deletedata: tableName and the free-form whereClause were interpolated raw. - insertdata: tableName and column names (object keys) were interpolated raw. - executetransaction: the same raw tableName/whereClause interpolation per operation. - createtable, createindex, droptable: table/column/index/schema identifiers were interpolated with no or insufficient validation. - listdatabases (reader tier): the stateFilter argument was interpolated raw into the query, with only a non-enforced inputSchema enum guarding it.

The only check on whereClause was that it was non-empty. Because the row-count and preview queries run before the confirmUpdate/confirmDelete step, a malicious whereClause or tableName executed on the first call, bypassing the preview/confirmation and maxRows safety controls. Request.query() submits a multi-statement T-SQL batch, so a crafted input enabled stacked statements (arbitrary DDL/DML), sub-selects, and (with a privileged login and xpcmdshell enabled) OS command execution. Because listdatabases is a read-only tool, the stateFilter sink makes the reader package injectable as well.

Impact

An actor who can supply tool arguments (a malicious or compromised MCP client, or an LLM agent steered via indirect prompt injection) could read, modify, or drop arbitrary data, bypass the readdata allow/deny validation and the preview/confirmation/maxRows safeguards, and conditionally achieve OS command execution.

Patches

Fixed in @connorbritain/mssql-mcp-core 0.6.0: - All identifiers are validated against a strict allowlist and bracket-quoted via a shared helper. - The free-form whereClause string parameter is removed (breaking change) and replaced with structured, parameterized filters ({ column, operator, value }) using an operator allowlist. Values are always bound, never interpolated. - listdatabases validates stateFilter against a fixed allowlist before use.

Upgrade the consumer packages: mssql-mcp-reader 0.5.0, mssql-mcp-writer 0.5.0, mssql-mcp-server 0.6.0 (all depend on core ^0.6.0).

Workarounds

Upgrading is the only complete fix; the listdatabases (stateFilter) sink is reachable even under READONLY=true and in the reader package. As defense in depth, run the server under a least-privilege SQL login with xpcmdshell disabled, and restrict which MCP clients can invoke the tools.

— GitHub

Affected Software

8 affected componentsFixes available
npm/mssql-mcp-core<0.6.0
npm/mssql-mcp-server<0.6.0
npm/mssql-mcp-reader<0.5.0
npm/mssql-mcp-writer<0.5.0
npm/@connorbritain/mssql-mcp-server<=0.5.2
0.6.0
npm/@connorbritain/mssql-mcp-writer<=0.4.2
0.5.0
npm/@connorbritain/mssql-mcp-reader<=0.4.2
0.5.0
npm/@connorbritain/mssql-mcp-core<=0.5.0
0.6.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@connorbritain/mssql-mcp-server to a version that resolves this vulnerability.

    Fixed in 0.6.0
  2. Upgrade

    Upgrade npm/@connorbritain/mssql-mcp-writer to a version that resolves this vulnerability.

    Fixed in 0.5.0
  3. Upgrade

    Upgrade npm/@connorbritain/mssql-mcp-reader to a version that resolves this vulnerability.

    Fixed in 0.5.0
  4. Upgrade

    Upgrade npm/@connorbritain/mssql-mcp-core to a version that resolves this vulnerability.

    Fixed in 0.6.0
  5. Upgrade

    Upgrade @connorbritain/mssql-mcp-core to a version that resolves this vulnerability.

    Fixed in 0.6.0
  6. Upgrade

    Upgrade mssql-mcp-server to a version that resolves this vulnerability.

    Fixed in 0.6.0
  7. Upgrade

    Upgrade mssql-mcp-reader to a version that resolves this vulnerability.

    Fixed in 0.5.0
  8. Upgrade

    Upgrade mssql-mcp-writer to a version that resolves this vulnerability.

    Fixed in 0.5.0
  9. Configuration

    Disable xp_cmdshell.

    SQL Server xp_cmdshell = disabled
  10. Compensating control

    Run the server under a least-privilege SQL login.

  11. Compensating control

    Restrict which MCP clients can invoke the tools.

Event History

Nov 18, 2026
CVE Published
via MITRE·07:59 PM
Data Sourced
via MITRE·07:59 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:19 PM
DescriptionSeverityWeakness
Nov 19, 2026
Advisory Published
via GitHub·12:46 AM
Data Sourced
via GitHub·12:46 AM
DescriptionSeverityWeaknessAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203