Skip to content

Agent Zero AI framework

Upgrade FastMCP to 3.2.4 / MCP to 1.27.0 for CVE-2026-32871

Alessandrob73da881c64d
diff --git a/requirements.txt b/requirements.txt
index 189b6f4ba..8add74428 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,7 +4,7 @@ browser-use==0.5.11
docker==7.1.0
duckduckgo-search==6.1.12
faiss-cpu==1.11.0
-fastmcp==2.13.1
+fastmcp==3.2.4
fasta2a==0.5.0
flask[async]==3.0.3
flask-basicauth==0.2.0
@@ -20,7 +20,7 @@ langchain-unstructured==0.1.6
openai-whisper==20250625
lxml_html_clean>=0.4.0 # CVE-2024-52595 fix: XSS CWE-79 CVSS 8.4
markdown==3.7
-mcp==1.22.0
+mcp==1.27.0
newspaper3k==0.2.8
paramiko==3.5.0
playwright==1.52.0
diff --git a/tests/test_fastmcp_openapi_security.py b/tests/test_fastmcp_openapi_security.py
new file mode 100644
index 000000000..094f11882
--- /dev/null
+++ b/tests/test_fastmcp_openapi_security.py
@@ -0,0 +1,62 @@
+import sys
+from pathlib import Path
+
+import httpx
+import pytest
+from fastmcp.server.providers.openapi import OpenAPIProvider
+
+PROJECT_ROOT = Path(__file__).resolve().parents[1]
+if str(PROJECT_ROOT) not in sys.path:
+ sys.path.insert(0, str(PROJECT_ROOT))
+
+
+OPENAPI_SPEC = {
+ "openapi": "3.1.0",
+ "info": {"title": "FastMCP security regression", "version": "1.0.0"},
+ "paths": {
+ "/api/v1/users/{id}/profile": {
+ "get": {
+ "operationId": "get_user_profile",
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "required": True,
+ "schema": {"type": "string"},
+ }
+ ],
+ "responses": {"200": {"description": "ok"}},
+ }
+ }
+ },
+}
+
+
+async def test_openapi_provider_percent_encodes_path_parameters():
+ captured = {}
+
+ async def handler(request: httpx.Request) -> httpx.Response:
+ captured["path"] = request.url.path
+ captured["raw_path"] = request.url.raw_path.decode("ascii")
+ captured["authorization"] = request.headers.get("authorization")
+ return httpx.Response(200, json={"ok": True})
+
+ transport = httpx.MockTransport(handler)
+ async with httpx.AsyncClient(
+ base_url="http://backend.local/",
+ headers={"Authorization": "Bearer admin_secret"},
+ transport=transport,
+ ) as client:
+ provider = OpenAPIProvider(openapi_spec=OPENAPI_SPEC, client=client)
+ tool = await provider.get_tool("get_user_profile")
+
+ assert tool is not None
+
+ result = await tool.run({"id": "../../../admin/delete-all?"})
+
+ assert result.structured_content == {"ok": True}
+ assert captured["authorization"] == "Bearer admin_secret"
+ assert captured["path"].startswith("/api/v1/users/")
+ assert captured["raw_path"].startswith("/api/v1/users/%2E%2E%2F")
+ assert captured["raw_path"].endswith("/profile")