MCP server security sweep: 12 findings across the Model Context Protocol ecosystem
Aggregate writeup of 12 audit-cleared security findings across Model Context Protocol servers and SDKs: command injection, SQL/tool-scope violations, SSRF bypasses, and resource-exhaustion bugs. Reported via GitHub private advisory and direct maintainer channels, submissions in progress.
Background
The Model Context Protocol (MCP) is the integration layer that connects a large language model to external tools and data sources. An MCP host (Claude Desktop, Continue, Windsurf, and similar) speaks to one or more MCP servers, each of which advertises a set of named tools. The model decides which tool to call and with which arguments, and the server executes the corresponding action against a shell, a database, an HTTP endpoint, or a filesystem. The protocol moved from a niche Anthropic specification to a broad ecosystem during 2025 and 2026, and the community server population grew far faster than the security review that would normally accompany code that executes model-chosen actions.
The security model of an MCP server is unusual. In a conventional API the caller is a program written by a human who is bound by the API contract. In an MCP server the caller is a language model whose argument values can be steered by prompt injection in any untrusted content the model reads, and the only authority gate the agent framework provides is the tool name and the tool description. A tool named read_query or write_query carries an implicit promise about what statement classes it will run. A tool named executeCommand with a documented allowlist carries an implicit promise about which binaries it will spawn. When a server fails to enforce that promise at runtime, the gap is reachable by any content the model can be induced to act on.
This writeup aggregates a single audit sweep run on 2026-05-18 to 2026-05-19 against the Anthropic-official MCP repositories, the SDKs, and a sample of community servers. The sweep produced 12 findings that survived a strict internal re-verification pass against the repository HEAD, with confirmed reproducers and CVSS scoring that was deliberately held to defensible values rather than inflated. A larger set of candidate findings was filtered out as duplicates, documented wont-fix decisions, or specification-compliant behavior, and those negative results are summarized at the end.
The findings cluster into four bug classes: OS command injection in shell-wrapping servers, statement-class and tool-scope violations in database servers, server-side request forgery in HTTP-fetching components, and resource-exhaustion or session-isolation defects in the reference SDK. The remainder of this document walks through each class with the concrete affected code, then covers scoring discipline, disclosure channels, and the current status.
Command injection in shell-wrapping servers
Three community servers expose shell execution behind a tool that claims to be sandboxed by an allowlist, and in each case the allowlist constrains the command name but not the arguments, so shell metacharacters in an argument escape into the surrounding shell.
The clearest case is cfdude/mac-shell-mcp. The server runs commands through Node's child_process.execFile with the option shell: '/bin/zsh'. Node documents that when the shell option is truthy, execFile joins the command and its arguments into a single string and hands that string to <shell> -c, which means any shell metacharacter inside an argument becomes live. The validateCommand gate matches only the command basename against a fixed list (ls, pwd, echo, cat, grep, find, head, tail, wc, and similar) and does not constrain the argument array unless an explicit per-entry allowedArgs regex is configured. None of the default safe entries carry such a regex. A model-driven call of the shape executeCommand('echo', ['BENIGN; id; cat /etc/passwd']) therefore runs echo followed by the injected commands. The reproducer captured uid/gid output and the first lines of /etc/passwd from a single tool call. The fix is to drop the shell option so that the argument vector is passed verbatim to execve with no shell interpretation, which the same maintainer already does by default in a sibling project. The vulnerable call lives in src/services/command-service.ts.
The second case is spences10/mcp-wsl-exec, where a sanitizer attempts to strip dangerous shell constructs but is bypassable, leaving command injection reachable through the WSL execution path. The third, surfaced as a bonus during the sweep, is 0xshariq/docker-mcp-server, which contains six distinct shell-command-injection sinks in tools that build Docker command lines by string concatenation. That server has neither a SECURITY.md nor private advisory reporting enabled, so it was disclosed by direct GPG-signed email to the maintainer on 2026-06-02 with a coordinated-disclosure timeline of 14-day acknowledgement and 90-day public deadline.
These three carry CWE-78 (OS command injection) and CWE-88 (argument injection). The scoring was held to High rather than Critical: the attack vector is the local LLM tool-call path on a developer workstation rather than an unauthenticated network listener, and the impact is bounded by the privileges of the account running the MCP host, which is typically a developer account with broad filesystem access but not root.
Database servers that do not enforce their own tool scope
Two database servers expose tools whose names promise a statement class they never enforce.
Zhwt/go-mcp-mysql advertises four tools: read_query, write_query, update_query, and delete_query. None of the four enforces the statement class at runtime unless the server is started with the optional -with-explain-check flag, which defaults to false. With the default configuration, write_query accepts DROP TABLE users, GRANT ALL ON *.* TO 'attacker'@'%', and arbitrary DDL or DCL, because the handler delegates to an HandleExplain routine that early-returns nil when the check is disabled. The MySQL driver disables multi-statement piping by default, so an attacker cannot append ; DROP TABLE to a query, but every single-statement abuse remains open: privilege escalation through GRANT, data destruction through DROP DATABASE, and file read or write through LOAD_FILE and INTO OUTFILE when the configured database account holds the FILE privilege. Even with the explain-check enabled, DDL and DCL statements cause EXPLAIN to error and the error path fails open rather than rejecting. A secondary defect is desc_table, which builds SHOW CREATE TABLE %s by string formatting with no identifier escaping, giving an attacker-controlled identifier path into the query. This finding carries CWE-1287 (improper validation of specified type of input) as the primary class and CWE-89 (SQL injection) as the secondary, and is the highest-scored finding in the sweep at CVSS 8.8 High. The reproducer is a self-contained Go program that mirrors the handler control flow and prints EXECUTED: DROP TABLE users for the default configuration.
The companion findings are gldc/mcp-postgres, which combines a table:// resource SQL-injection path with a WITH-CTE read-only bypass, and perrypixel/Easy-Postgres-MCP, which uses a WITH-CTE construct to smuggle write statements past a read-only intent gate. Both carry CWE-693 (protection mechanism failure), with CWE-184 (incomplete denylist) on the Easy-Postgres case where a prefix denylist is the broken read-only mechanism. A related finding, supabase-community/supabase-mcp, allows a branch-scope bypass where branch-targeting tools accept a branch_id that belongs to a different project than the one the server was scoped to, mapped to CWE-863 (incorrect authorization).
Server-side request forgery in HTTP-fetching components
Two findings are SSRF in components that fetch a model-supplied or publisher-supplied URL.
The MCP Inspector exposes a POST /fetch endpoint that forwards any supplied URL through node-fetch with no destination IP blocklist. Validation is limited to an http:/https: scheme check and an Origin header allowlist that defaults to http://localhost:6274. There is no filtering of loopback, link-local (including the 169.254.169.254 cloud-metadata address), or RFC1918 ranges. Redirects are followed by default, so a public host can redirect into http://127.0.0.1, and DNS names that resolve to loopback pass through. The Origin gate is skipped entirely for callers that send no Origin header, because the check is written as if (origin && !allowedOrigins.includes(origin)). The remaining barrier is a session token that is leaked into the client URL, printed to stdout at startup, and disabled outright when a developer sets the documented DANGEROUSLY_OMIT_AUTH=true. The Inspector has prior SSRF and related advisories (CVE-2025-49596 / GHSA-7f8r-222p-6f5g and CVE-2025-58444 / GHSA-g9hg-qhmf-q45m), and this finding is a distinct unblocked destination path rather than a duplicate of either.
The second SSRF is in modelcontextprotocol/registry. The fix for CVE-2026-44430 added four IPv6 prefix families to the isBlockedIP blocklist to stop addresses that tunnel or embed an arbitrary IPv4. That patch missed IPv4-compatible IPv6 (::/96), the canonical RFC 4291 prefix in exactly the class the patch was addressing. An attacker who controls DNS for a publisher domain can publish an AAAA record such as ::a9fe:a9fe, whose low 32 bits are 169.254.169.254, and the namespace-verification fetcher will dial it. The patch explicitly handled the neighbouring IPv4-mapped form (::ffff:0:0/96) and added it as a regression guard, which indicates the author considered the mapped-versus-compatible distinction and guarded the wrong one. Both findings carry CWE-918 (SSRF), with CWE-184 (incomplete denylist) on the registry case because it is a blocklist gap, and CWE-441 (unintended proxy) noted on the Inspector case. The registry finding was scored Medium (4.4) because exploitation requires the attacker to control DNS for a domain they can submit, which raises attack complexity.
SDK resource exhaustion and session isolation
Two findings are in the official modelcontextprotocol/typescript-sdk. The first is a ReadBuffer that grows through repeated Buffer.concat with no upper bound, so a peer that streams data without a message delimiter drives unbounded memory growth, an out-of-memory denial of service. This maps to CWE-770 (allocation without limits) and was scored Medium (6.2). The second is an InMemoryTaskStore session leak where task state is keyed in a way that lets one client observe or reach another client's session state, a cross-client isolation defect mapped to CWE-862 (missing authorization) with CWE-285, scored High (7.1). A seventh finding in the same family, against github/github-mcp-server, is a sanitizer bypass using zero-width-joiner and related Unicode tricks to slip content past a content filter, mapped to CWE-176, CWE-1039, CWE-441, and CWE-184. Because that repository runs its security intake through a HackerOne program that scoped this class out, it was disclosed by GPG-signed email to opensource-security@github.com rather than through a private advisory.
Scoring discipline and what was filtered out
The sweep deliberately avoided the score inflation that is common in automated MCP security reports. CVSS values that started at 9.0 or 9.8 in the raw hunt were corrected downward where the attack vector is the local LLM tool-call path rather than an unauthenticated network listener, where privileges-required could not honestly be set to none, and where scope could not be shown to cross an authority boundary. The final distribution is nine High, two Medium, and one finding whose vector was left to be settled with the maintainer; none were scored Critical. The CWE mappings were corrected away from a reflexive CWE-862 (missing authorization) toward the more precise CWE-1287, CWE-693, or CWE-184 wherever the real defect was a broken validation or protection mechanism rather than an absent authorization check.
Several candidate targets were filtered out and are recorded as negative results so the sweep is auditable. One community shell server already had a published advisory through a third-party CNA and was not re-reported. Two SDK behaviors that looked like denial-of-service bugs were documented design decisions backed by prior pull-request discussion or by an explicit specification clause for malformed clients. A LangChain MCP adapter trust-boundary observation duplicated prior published research. A Microsoft markitdown-mcp default-bind concern was an already-documented wont-fix. Five further targets were investigated and produced no finding: the generic mcp-fetch SSRF path, the server-filesystem path-traversal path, the memory server, the everything server, and an arxiv-server CRLF path. Recording these keeps the accepted findings credible and avoids the pattern where a researcher reports everything they touched.
Status
This is a coordinated-disclosure sweep in progress, not a set of published advisories. As of the writeup the twelve findings are reported and routed: ten through GitHub private vulnerability reporting on the respective repositories, one to opensource-security@github.com for the GitHub MCP server, and one by direct GPG-signed email to the 0xshariq/docker-mcp-server maintainer (sent 2026-06-02 with a 14-day acknowledgement and 90-day public deadline). No GHSA identifier or CVE has been assigned to any of the twelve at the time of writing, and none should be cited as published. The advisory identifiers and CVE numbers referenced above belong to prior published work on the same components and are included only to establish that these findings are distinct from, not duplicates of, existing disclosures. This page will be updated with assigned advisory identifiers and patched versions as the maintainers triage and publish.
References
- MCP Inspector prior advisory GHSA-7f8r-222p-6f5g (CVE-2025-49596)
- MCP Inspector prior advisory GHSA-g9hg-qhmf-q45m (CVE-2025-58444)
- MCP Registry SSRF prior fix CVE-2026-44430 (the patch this finding bypasses)
- CWE-78 OS Command Injection, CWE-88 Argument Injection
- CWE-89 SQL Injection, CWE-1287 Improper Validation of Specified Type of Input, CWE-693 Protection Mechanism Failure
- CWE-918 Server-Side Request Forgery, CWE-184 Incomplete List of Disallowed Inputs
- CWE-770 Allocation of Resources Without Limits, CWE-862 Missing Authorization