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.txtindex 189b6f4ba..8add74428 100644--- a/requirements.txt+++ b/requirements.txt@@ -4,7 +4,7 @@ browser-use==0.5.11docker==7.1.0duckduckgo-search==6.1.12faiss-cpu==1.11.0-fastmcp==2.13.1+fastmcp==3.2.4fasta2a==0.5.0flask[async]==3.0.3flask-basicauth==0.2.0@@ -20,7 +20,7 @@ langchain-unstructured==0.1.6openai-whisper==20250625lxml_html_clean>=0.4.0 # CVE-2024-52595 fix: XSS CWE-79 CVSS 8.4markdown==3.7-mcp==1.22.0+mcp==1.27.0newspaper3k==0.2.8paramiko==3.5.0playwright==1.52.0diff --git a/tests/test_fastmcp_openapi_security.py b/tests/test_fastmcp_openapi_security.pynew file mode 100644index 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")