Home/Research/Post

GHSA-2m9m-6cr5-9×25: mssql-mcp-core: SQL injection in mssql-mcp write tools via unparameterized table names and WHERE clauses

  • Severity: HIGH
  • CVE: CVE-2026-63129
  • Ecosystems: npm, npm, npm, npm
  • Packages: @connorbritain/mssql-mcp-core, @connorbritain/mssql-mcp-reader, @connorbritain/mssql-mcp-writer, @connorbritain/mssql-mcp-server

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:
– `update_data`, `delete_data`: `tableName` and the free-form `whereClause` were interpolated raw.
– `insert_data`: `tableName` and column names (object keys) were interpolated raw.
– `execute_transaction`: the same raw `tableName`/`whereClause` interpolation per operation.
– `create_table`, `create_index`, `drop_table`: table/column/index/schema identifiers were interpolated with no or insufficient validation.
– `list_databases` (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 `xp_cmdshell` enabled) OS command execution. Because `list_databases` is a read-only tool, the `stateFilter` sink makes the reader package injectable as well.

## Impact

An actor who can supply tool arguments (a…

Source: GitHub Security Advisories · 2026-11-19