Skip to content

[Rule Request] TypeScript rules for mcp-command-injection and mcp-ssrf #3873

Description

@Lonkins

Gap

All five MCP security rules in ai/ai-best-practices/ exist only for Python. The official MCP
TypeScript SDK (@modelcontextprotocol/sdk) is the primary language for MCP server development,
yet none of these rules fire on TypeScript code.

Proposed additions

Two new TypeScript rules (extending existing Python ones):

  • mcp-command-injection-typescript — flags exec()/execSync()/eval() with a non-literal
    argument inside server.tool() or server.registerTool() callbacks (CWE-78, ERROR)
  • mcp-ssrf-typescript — flags fetch()/axios.get/post/put/delete()/https.get() with a
    non-literal URL inside MCP tool handler callbacks (CWE-918, ERROR)

Both cover the MCP SDK v1 (server.tool) and v2 (server.registerTool) APIs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions