GHSA-2m9m-6cr5-9x25

Suggest an improvement
Source
https://github.com/advisories/GHSA-2m9m-6cr5-9x25
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-2m9m-6cr5-9x25/GHSA-2m9m-6cr5-9x25.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-2m9m-6cr5-9x25
Aliases
Published
2026-11-19T00:46:38Z
Modified
2026-11-19T01:00:05Z
Severity
  • 8.8 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
mssql-mcp-core: SQL injection in mssql-mcp write tools via unparameterized table names and WHERE clauses
Details

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 malicious or compromised MCP client, or an LLM agent steered via indirect prompt injection) could read, modify, or drop arbitrary data, bypass the read_data 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.
  • list_databases 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 list_databases (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 xp_cmdshell disabled, and restrict which MCP clients can invoke the tools.

Database specific
{
    "cwe_ids": [
        "CWE-89"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-19T00:46:38Z",
    "nvd_published_at": "2026-11-18T20:19:10Z",
    "severity": "HIGH"
}
References

Affected packages

npm
@connorbritain/mssql-mcp-core

Package

Name
@connorbritain/mssql-mcp-core
View open source insights on deps.dev
Purl
pkg:npm/%40connorbritain/mssql-mcp-core

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.6.0

Database specific

last_known_affected_version_range
"<= 0.5.0"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-2m9m-6cr5-9x25/GHSA-2m9m-6cr5-9x25.json"
@connorbritain/mssql-mcp-reader

Package

Name
@connorbritain/mssql-mcp-reader
View open source insights on deps.dev
Purl
pkg:npm/%40connorbritain/mssql-mcp-reader

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.5.0

Database specific

last_known_affected_version_range
"<= 0.4.2"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-2m9m-6cr5-9x25/GHSA-2m9m-6cr5-9x25.json"
@connorbritain/mssql-mcp-writer

Package

Name
@connorbritain/mssql-mcp-writer
View open source insights on deps.dev
Purl
pkg:npm/%40connorbritain/mssql-mcp-writer

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.5.0

Database specific

last_known_affected_version_range
"<= 0.4.2"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-2m9m-6cr5-9x25/GHSA-2m9m-6cr5-9x25.json"
@connorbritain/mssql-mcp-server

Package

Name
@connorbritain/mssql-mcp-server
View open source insights on deps.dev
Purl
pkg:npm/%40connorbritain/mssql-mcp-server

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.6.0

Database specific

last_known_affected_version_range
"<= 0.5.2"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-2m9m-6cr5-9x25/GHSA-2m9m-6cr5-9x25.json"