Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Security] SQL Injection Vulnerability in ListTableTool.ts (MssqlMcp/Node/src/tools)

Open
#92 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
node.js, sql, typescript

Research direction

Start with MssqlMcp/Node/src/tools/ListTableTool.ts and inspect the run() method, especially how the parameters array is used to build the schema filter. Reproduce the supplied malicious input against the sample, then verify that schema values cannot alter the query and that normal table listing still works.

Written by the indexing model from the issue text.

Description

Summary

The ListTableTool class in the Node.js MCP sample is vulnerable to SQL injection attacks due to unsanitized user input being directly interpolated into a dynamic SQL query. This affects the run() method when filtering by schemas via the parameters array.

Affected File: MssqlMcp/Node/src/tools/ListTableTool.ts

Steps to Reproduce

  1. Instantiate the ListTableTool and call run() with malicious input:
    {
      "parameters": ["dbo'; SELECT name FROM sys.databases --"]
    }
    
    

query becomes:
SELECT TABLE_SCHEMA + '.' + TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA IN ('dbo'; SELECT name FROM sys.databases --') ORDER BY TABLE_SCHEMA, TABLE_NAME

Dominant language
HTML
Stars
331
Forks
208
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure-Samples/SQL-AI-samples

All issues in Azure-Samples/SQL-AI-samples

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.