Static review of public source at commit f46d9578190b. No traffic was sent to any MCP environment.
The Fetch MCP server retrieves arbitrary URLs with redirects enabled and no private/link-local/metadata IP checks:
src/fetch/src/mcp_server_fetch/server.py:
async with AsyncClient(proxy=proxy_url) as client:
response = await client.get(
url,
follow_redirects=True,
headers={"User-Agent": user_agent},
timeout=30,
)
The README already documents the risk (This server can access local/internal IP addresses…). Robots.txt handling is present; SSRF egress control is not. A model-controlled url (or a redirect hop) can therefore reach loopback, RFC1918, link-local, or cloud metadata endpoints from the host that runs the server.
Suggested change (defense-in-depth, opt-out for demos):
- Resolve hostname → IP(s) before connect; block private/special-purpose ranges and known metadata addresses by default (revalidate on each redirect hop).
- Add
--allow-private-ips / env escape hatch and document it next to the existing CAUTION.
- Prefer the same posture pydantic-ai’s
safe_download / similar libraries use (block-by-default, explicit allow_local).
Severity: medium as insecure default for an agent-facing fetch tool; README already discloses the class of risk. Not filed as a novel CVE claim. No proof-of-concept.
Happy to send a focused PR if useful.
Static review of public source at commit
f46d9578190b. No traffic was sent to any MCP environment.The Fetch MCP server retrieves arbitrary URLs with redirects enabled and no private/link-local/metadata IP checks:
src/fetch/src/mcp_server_fetch/server.py:The README already documents the risk (
This server can access local/internal IP addresses…). Robots.txt handling is present; SSRF egress control is not. A model-controlledurl(or a redirect hop) can therefore reach loopback, RFC1918, link-local, or cloud metadata endpoints from the host that runs the server.Suggested change (defense-in-depth, opt-out for demos):
--allow-private-ips/ env escape hatch and document it next to the existing CAUTION.safe_download/ similar libraries use (block-by-default, explicit allow_local).Severity: medium as insecure default for an agent-facing fetch tool; README already discloses the class of risk. Not filed as a novel CVE claim. No proof-of-concept.
Happy to send a focused PR if useful.