Skip to content
Agentic Control Plane
Security series · Part 6 of 3
MCP Security →

MCP Security Vulnerabilities: 4 Tool Schema Patterns Behind Real CVEs

David Crowe David Crowe · · Updated · 13 min read
security-research mcp schemas cve
Share X HN LinkedIn

Every MCP tool starts as a JSON schema. The schema tells the model which parameters to send and what type each one is. It is also the first line of defense between an AI agent and your infrastructure, and often the only one.

When the schema says "type": "string" and nothing else, the model can send anything. ../../etc/passwd. ; rm -rf /. A URL that points at a cloud metadata service. Unless someone wrote custom validation, the server runs it.

This has already happened. Several CVEs in MCP servers trace back to unconstrained schema parameters, including Anthropic’s Filesystem server, its Git server, FastMCP, and mcp-remote. Each one is a string parameter with no limits.

In a March 2026 scan of public MCP registries we found 4,512 high-risk input parameters with no validation constraints. This post covers the four patterns behind them, what the real exploits looked like, and how to fix each in the schema.

Try the interactive scanner on your own schema →


1. Free-form file paths

The most common dangerous pattern:

{
  "name": "read_file",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": { "type": "string", "description": "File path to read" }
    },
    "required": ["path"]
  }
}

The schema says the path is a string, and nothing about what kind. An agent can send ../../etc/passwd, a symlink that points to /etc/sudoers, or a path that starts with the allowed directory’s name and runs into a sibling: /tmp/allowed_dir_sensitive_credentials.

The CVEs

This pattern caused CVE-2025-53110 (CVSS 7.3) and CVE-2025-53109 (CVSS 8.4) in Anthropic’s Filesystem MCP Server, found by Cymulate.

CVE-2025-53110 came from a prefix check using startsWith(). If the allowed directory was /tmp/allowed_dir, the path /tmp/allowed_dir_sensitive_credentials passed the check. CVE-2025-53109 went further. Crafted symlinks got past fs.realpath() validation through a flawed error handler, which gave full read and write access to the filesystem.

The attack: create a symlink to /etc/sudoers, read it through the MCP tool, and escalate privileges. On macOS, an attacker could also drop a malicious Launch Agent for persistent code execution.

Three more from the same pattern

Anthropic’s Git MCP Server had CVE-2025-68145, CVE-2025-68143 and CVE-2025-68144, reported by Cyata and fixed in December 2025. The --repository flag was meant to limit access to one path. But later calls could pass a different repo_path, and nothing checked it. git_init accepted any filesystem path, so any directory, .ssh included, could become a git repository.

CVE-2025-68144 was argument injection through the target parameter in git_diff. Injecting --output=/path/to/file let an attacker overwrite any file. Researcher Yarden Porat described the setup to The Register: “Your IDE reads something malicious, a README file, a webpage, a GitHub issue, somewhere the attacker has planted instructions.”

The fix

{
  "name": "read_document",
  "description": "Read a document from the project directory.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "pattern": "^[a-zA-Z0-9][a-zA-Z0-9/_.-]*\\.(md|txt|json)$",
        "maxLength": 256,
        "description": "Relative path within the project directory. No directory traversal."
      }
    },
    "required": ["path"]
  }
}

The pattern rejects .., absolute paths, and anything without a known file extension. maxLength caps the input size. The description tells the model what to send, and tells a reviewer what to check.

Our scan found 357 path parameters with no pattern, enum or format. Each has the same exposure as the Filesystem server before it was patched.


2. Unconstrained URLs

{
  "name": "fetch_url",
  "inputSchema": {
    "type": "object",
    "properties": {
      "url": { "type": "string" },
      "method": { "type": "string" }
    },
    "required": ["url"]
  }
}

A url parameter with no validation means the server will request whatever the agent hands it. That is server-side request forgery (SSRF): the attacker gets your server to make requests for them. It is everywhere in MCP.

The CVEs

CVE-2026-32871 in FastMCP’s OpenAPI provider: _build_url() put path parameter values into URL templates without URL-encoding them. Because urljoin() reads ../ as a step up, an attacker who controlled a path parameter could leave the intended API prefix and reach other backend endpoints, with the provider’s own auth headers attached.

BlueRock Security analyzed over 7,000 MCP servers and found 36.7% had possible SSRF exposure through unbounded URL parameters. Their demo against Microsoft’s MarkItDown MCP server used an open URI parameter to query the cloud metadata endpoint and pull out IAM credentials.

CVE-2025-6514 in mcp-remote (CVSS 9.6) allowed OS command injection through an OAuth URL parameter. A malicious server could answer with a crafted authorization_endpoint and run commands on the client machine. JFrog counted more than 437,000 installs, and mcp-remote appeared in integration guides from Cloudflare, Hugging Face and Auth0.

The fix

The best fix is an enum, a closed list of allowed values:

{
  "name": "get_api_data",
  "description": "Fetch data from pre-approved API endpoints only.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "endpoint": {
        "type": "string",
        "enum": ["/api/v1/users", "/api/v1/orders", "/api/v1/products"]
      }
    },
    "required": ["endpoint"]
  }
}

No arbitrary URLs means no SSRF. When an enum won’t work, the minimum is a pattern that requires HTTPS:

"url": {
  "type": "string",
  "pattern": "^https://[a-zA-Z0-9]",
  "format": "uri"
}

A pattern like this does not block private IP ranges. For that, the server has to resolve the host and check the address itself.

We found 831 SSRF-prone parameters. Most are url, endpoint or webhook parameters typed as a bare string.


3. Raw query and command strings

{
  "name": "execute_query",
  "inputSchema": {
    "type": "object",
    "properties": {
      "query": { "type": "string" },
      "database": { "type": "string" }
    },
    "required": ["query"]
  }
}

The query parameter takes any string. If the server passes it to a database, that is SQL injection. If it passes it to a shell, that is command injection. The schema gives no hint of what is safe.

Why this is worse with agents

In a web app, injection happens when a person types something malicious into a form. With MCP, the model writes the parameter. An attacker doesn’t need direct access to the input. They only need to influence what the model reads.

A malicious README in a repo. A poisoned issue description. A web page the agent fetches for context. Any of them can carry instructions that make the model write a malicious query. The model follows instructions, the schema allows anything, and the server runs it.

Simon Willison calls the combination the lethal trifecta: an agent with access to private data, exposure to untrusted content, and a way to send data out. If an agent has all three, an attacker can trick it into leaking the data, and nobody knows how to prevent that with full reliability.

The fix

Replace free-form strings with constrained fields:

{
  "name": "search_records",
  "inputSchema": {
    "type": "object",
    "properties": {
      "collection": {
        "type": "string",
        "enum": ["users", "orders", "products"]
      },
      "field": {
        "type": "string",
        "enum": ["name", "email", "status", "created_at"]
      },
      "value": {
        "type": "string",
        "maxLength": 200,
        "pattern": "^[^;'\"]+$"
      },
      "limit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 50
      }
    },
    "required": ["collection", "field", "value"]
  }
}

collection and field are enums, so there are no arbitrary table or column names. value rejects common SQL characters. limit is bounded, so an agent can’t ask for a million rows. A pattern like this is a backstop. The server should still use parameterized queries.

Our scan found 566 SQL injection parameters, 368 command injection parameters and 740 code injection parameters, all taking arbitrary strings. Add the finding from our auth audit that most servers use static credentials or none, and many of these are one prompt injection from being exploited.


4. Destructive operations with no limits

{
  "name": "delete_records",
  "inputSchema": {
    "type": "object",
    "properties": {
      "table": { "type": "string" },
      "where": { "type": "string" }
    },
    "required": ["table"]
  }
}

This tool deletes from any table with any WHERE clause. It has no confirmation step, no scope limit, and no cap on how much it can remove.

It is not a bug in the usual sense. It just gives no protection against misuse. When an agent calls a delete tool on its own, the schema should limit what can be deleted and how much.

The fix

{
  "name": "archive_record",
  "description": "Soft-delete a single record by ID. Requires confirmation.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "collection": {
        "type": "string",
        "enum": ["orders", "drafts"]
      },
      "record_id": {
        "type": "string",
        "pattern": "^[a-zA-Z0-9_-]{1,64}$"
      },
      "confirm": {
        "type": "boolean",
        "description": "Must be true to execute the deletion."
      }
    },
    "required": ["collection", "record_id", "confirm"]
  }
}

Three changes. The name says what it does (archive_record, not delete_records). It works on one record by ID, with no bulk WHERE clause. And a confirm flag makes the agent state its intent. The flag is a speed bump for the model, not a human approval.


What to do now

Audit your schemas. Look for string parameters on dangerous operations (file reads, database queries, HTTP requests, shell commands) that have no pattern, enum, format or maxLength. Those are the parameters that show up in CVEs.

Scan your tool definitions with the free browser scanner. Paste your tools/list response and it marks which parameters are open. It runs in your browser, and nothing leaves it.

Use enums where you can. If a tool only needs three API endpoints, list the three. Don’t accept a URL. This removes whole classes of bug.

Add patterns to the rest. "pattern": "^[a-zA-Z0-9/_.-]+$" on a path parameter blocks ../. "pattern": "^https://" on a URL parameter blocks non-HTTPS URLs. Each is one line.


Schemas are not enough

Every issue here has a schema fix. But the MCP spec doesn’t require servers or clients to enforce schema validation. And a tight schema can’t stop tool poisoning, where malicious instructions sit in a tool’s description and the model obeys them. It can’t stop rug pulls either, where a tool’s definition changes after you approved it.

Those are design problems. Invariant Labs, after showing data theft through the GitHub MCP server, said it was not a flaw in that server’s code but an architectural issue that has to be addressed at the agent-system level.

Part of the answer is a check outside the server. ACP sits in the coding agent’s hooks and checks each tool call, MCP tools included, before it runs. Your rules decide allow, ask or deny, and every decision is logged. Be clear about the limit: the rules key on the tool (for example, which MCP server and tool the agent is calling), not on the values inside its arguments. The built-in safety floor reads shell command text only, so it does not look inside MCP parameters. ACP is a second layer for which tools an agent may call at all. It does not replace validating inputs in the server. See the control plane write-up for how the two fit together.

Correction (2026-07-18): An earlier version of this post attributed a direct quote to The Register that does not appear in the cited article. It has been replaced with researcher Yarden Porat’s actual quote, as reported by The Register.

Scan your schemas → · Read the full security checklist → · Get started free →


Method and sources

The counts come from a static scan of public MCP registry tool definitions in March 2026, using regex matching on tool names, descriptions and schema property names. See the full write-up for the corpus. CVE details are from NVD, vendor advisories and the original researchers. The BlueRock SSRF figure is from their analysis of 7,000+ MCP servers. The schema examples are simplified. Production schemas need more constraints.

Related reading: 4,500 MCP Servers, Zero Input Validation · MCP Auth Appropriateness Audit · The MCP Audit Gap · I Audited 7,522 AI Agent Skills · OWASP Agentic Top 10

Running coding agents? ACP records each tool call its hook sees and makes the dangerous shell commands (a force-push, destructive SQL, curl | sh) wait for you. One command, free up to 5 agents:

macOS · Linux · WSL
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
Windows · PowerShell
irm https://agenticcontrolplane.com/install.ps1 | iex

What the installer writes  ·  Getting started

Share X HN LinkedIn
Get the next data drop
What agents actually cost, new tool-surface captures, and the occasional incident post-mortem — sent when we publish something worth your inbox, not on a schedule. Unsubscribe anytime.
Share: Twitter LinkedIn
More in MCP Security
  1. 3. MCP Server Audit Logging: I Checked 8,216 Servers. 74.9% Don't Mention It.
  2. 5. MCP Gateway Comparison (2026): Composio vs ACP vs DIY
  3. 6. MCP Security Vulnerabilities: 4 Tool Schema Patterns Behind Real CVEs · you are here
Related posts

← back to blog