Skip to content
HighVulnerability

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

Published
Record updated
View JSON
Affected
  • @connorbritain/mssql-mcp-server <= 0.5.2, fixed in 0.6.0, released June 29, 2026, 143 days before disclosure
  • @connorbritain/mssql-mcp-writer <= 0.4.2, fixed in 0.5.0, released June 29, 2026, 143 days before disclosure
  • @connorbritain/mssql-mcp-reader <= 0.4.2, fixed in 0.5.0, released June 29, 2026, 143 days before disclosure
  • and 1 more
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.

Summary

Several tools in `mssql-mcp-core` built T-SQL by string-interpolating caller-supplied identifiers and `whereClause` predicates into `Request.query()` batches, with only data values parameterized. Because preview queries ran before the `confirmUpdate`/`confirmDelete` step, a crafted input executed on the first call and bypassed the preview, confirmation and `maxRows` safeguards. An actor supplying tool arguments could read, modify or drop data and, under a privileged login with `xp_cmdshell` enabled, conditionally execute OS commands.

Mitigation

Fixed in `@connorbritain/mssql-mcp-core` 0.6.0: identifiers are validated against a strict allowlist and bracket-quoted, the free-form `whereClause` is removed (breaking change) in favor of parameterized `{ column, operator, value }` filters with an operator allowlist, and `list_databases` validates `stateFilter` against a fixed allowlist. Upgrade `mssql-mcp-reader` 0.5.0, `mssql-mcp-writer` 0.5.0 and `mssql-mcp-server` 0.6.0. Workaround: run the server under a least-privilege SQL login with `xp_cmdshell` disabled and restrict which MCP clients can invoke the tools.