π The fast, Pythonic way to build MCP servers and clients.
fix: require patched certifi trust stores (#5945)
nate nowackec1a8e031b2f
diff --git a/.github/workflows/run-downstream-smoke.yml b/.github/workflows/run-downstream-smoke.ymlindex 33e50844a..74cffc2f9 100644--- a/.github/workflows/run-downstream-smoke.yml+++ b/.github/workflows/run-downstream-smoke.yml@@ -154,6 +154,7 @@ jobs:working-directory: pydantic-airun: |echo "UV_RUN=uv run --all-extras --no-extra mcp-tasks --all-packages \+ --exclude-newer-package certifi=false \--exclude-newer-package pydocket=2026-10-03T00:00:00Z \--with fastmcp@file://$(ls $GITHUB_WORKSPACE/dist/fastmcp-4*.whl) \--with fastmcp-slim@file://$(ls $GITHUB_WORKSPACE/dist/fastmcp_slim-*.whl) \diff --git a/SECURITY.md b/SECURITY.mdindex fa10c54be..bea822e9d 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -10,6 +10,16 @@| 1.x | :x: || 0.x | :x: |+## Certificate authority incident: October 2026++The [eMudhra intermediate CA compromise](https://emudhra.we-have-a-problem.com/) can let an attacker intercept HTTPS connections when the application still trusts an affected certificate chain. This is an upstream trust-store incident; updating FastMCP alone does not protect every deployment.++FastMCP 3 uses certifi by default. FastMCP 4 uses the operating system's trust store through HTTPX2; some server dependencies and optional integrations still use certifi. Update certifi to **2026.10.19 or later** wherever it is installed, and update the CA stores in your operating system, containers, and custom TLS configuration. Rebuild affected images and restart processes after changing their trust stores. Both the direct emSign chains and the Sectigo/AAA cross-signed chains must be distrusted. Confirm that your distribution has shipped this change; installing its latest CA package is insufficient if the fix is still pending. The incident response page provides distribution status and interim guidance.++Update **uv to 0.13.4 or later** and **pip to 26.2.2 or later** where used. Update existing virtual environments too. Their bundled certificates are separate from the application's certifi package; pip can also trust system certificates, so updating pip does not replace the OS update. Supplying pip with `--cert` or `REQUESTS_CA_BUNDLE` adds trust and does not remove its bundled roots. See the [Python security team's guidance](https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576) for other affected tools.++Verify from the actual deployed runtime that the [incident test chains](https://emudhra.we-have-a-problem.com/#check) fail certificate verification and your normal upstream connections still work. A timeout is not evidence of distrust. Do not disable certificate verification to restore connectivity.+## Reporting a VulnerabilityPlease report security vulnerabilities privately using [GitHub's security advisory feature](https://github.com/PrefectHQ/fastmcp/security/advisories/new). Do not open public issues for security concerns.diff --git a/docs/clients/transports.mdx b/docs/clients/transports.mdxindex cc34d8c34..ef6af90c9 100644--- a/docs/clients/transports.mdx+++ b/docs/clients/transports.mdx@@ -137,8 +137,11 @@ client = Client(### SSL Verification-By default, HTTPS connections verify the server's SSL certificate. You can customize this behavior with the `verify` parameter, which accepts the same values as httpx2 (documented in [httpx's SSL guide](https://www.python-httpx.org/advanced/ssl/), which httpx2 follows):+By default, HTTPS connections verify the server's SSL certificate using the operating system's trust store through HTTPX2. You can customize this behavior with the `verify` parameter; see [HTTPX2's SSL guide](https://pydantic.dev/docs/httpx2/advanced/ssl/).+Keep the trust store used by your deployment current. Updating certifi does not update the operating system's CA store or a custom bundle selected by `SSL_CERT_FILE`, `SSL_CERT_DIR`, or `verify`. Custom client factories configure their own TLS verification. Rebuild containers and restart processes after updating trust stores. This also matters for servers making outbound HTTPS requests to OAuth providers, JWKS endpoints, and upstream APIs.++For the October 2026 eMudhra CA incident, follow the [FastMCP security notice](https://github.com/PrefectHQ/fastmcp/blob/main/SECURITY.md#certificate-authority-incident-october-2026). A FastMCP package upgrade alone does not remediate every trust store.```pythonfrom fastmcp import Clientdiff --git a/fastmcp_slim/pyproject.toml b/fastmcp_slim/pyproject.tomlindex 8f5b3b136..baeb96923 100644--- a/fastmcp_slim/pyproject.toml+++ b/fastmcp_slim/pyproject.toml@@ -67,10 +67,10 @@ bump = truefallback-version = "0.0.0"[tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]-anthropic = ["anthropic>=0.48.0,<2"]+anthropic = ["certifi>=2026.10.19", "anthropic>=0.48.0,<2"]apps = ["prefab-ui>=0.18.0"]# PyJWT floor: transitive via msal; CVE-2026-32597 affects <= 2.11.0-azure = ["azure-identity>=1.16.0", "PyJWT>=2.12.0"]+azure = ["certifi>=2026.10.19", "azure-identity>=1.16.0", "PyJWT>=2.12.0"]client = ["fastmcp-slim[mcp]=={{ version }}","authlib>=1.6.11",@@ -79,7 +79,7 @@ client = []code-mode = ["pydantic-monty>=1.1,<2"]jev = ["typesafe-sdk>=0.5.7"]-gemini = ["google-genai>=1.18.0", "jsonref>=1.1.0"]+gemini = ["certifi>=2026.10.19", "google-genai>=1.18.0", "jsonref>=1.1.0"]mcp = ["exceptiongroup>=1.2.2",# FastMCP uses httpx2 exclusively: the MCP SDK boundary (client transports,@@ -92,8 +92,9 @@ mcp = [# Pin past CVE-2026-48710, which was patched in 1.0.1."starlette>=1.0.1",]-openai = ["openai>=1.102.0"]+openai = ["certifi>=2026.10.19", "openai>=1.102.0"]server = [+ "certifi>=2026.10.19","fastmcp-slim[mcp]=={{ version }}","authlib>=1.6.11","beartype>=0.23.0rc2; python_version >= '3.15'",diff --git a/pyproject.toml b/pyproject.tomlindex d94ab7280..d62cf020e 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -80,7 +80,7 @@ exclude-newer = "1 week"# MCP SDK, where a new major is the only version satisfying our floor and so# has nothing older to fall back to, and uncalled-for, the DI engine whose# releases we adopt deliberately. Monty 1.1.0 supplies Python 3.15 wheels.-exclude-newer-package = { fastmcp = false, fastmcp-slim = false, fastmcp-remote = false, prefab-ui = false, mcp = false, mcp-types = false, uncalled-for = false, pydocket = false, pydantic-monty = false, pydantic-monty-client = false, pydantic-monty-runtime = false }+exclude-newer-package = { certifi = false, fastmcp = false, fastmcp-slim = false, fastmcp-remote = false, prefab-ui = false, mcp = false, mcp-types = false, uncalled-for = false, pydocket = false, pydantic-monty = false, pydantic-monty-client = false, pydantic-monty-runtime = false }[dependency-groups]dev = [diff --git a/uv.lock b/uv.lockindex 8abbab261..b0f5ce413 100644--- a/uv.lock+++ b/uv.lock@@ -20,6 +20,7 @@ exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included forexclude-newer-span = "P1W"[options.exclude-newer-package]+certifi = falsefastmcp = falsefastmcp-remote = falsefastmcp-slim = false@@ -349,11 +350,11 @@ wheels = [[[package]]name = "certifi"-version = "2026.6.17"+version = "2026.10.19"source = { registry = "https://pypi.org/simple" }-sdist = { url = "https://files.pythonhosted.org/packages/c9/c7/424b75da314c1045981bd9777432fad05a9e0c69daa4ed7e308bbaffe405/certifi-2026.6.17.tar.gz", hash = "sha256:024c88eeec92ca068db80f02b8b07c9cef7b9fe261d1d535abfd5abd6f6af432", size = 134594, upload-time = "2026-06-17T10:31:07.894Z" }+sdist = { url = "https://files.pythonhosted.org/packages/a6/bd/1436c50cc46699de0230fbaacc1d1de7bfec413176099949e9d5112e88f2/certifi-2026.10.19.tar.gz", hash = "sha256:035c1e85572b141bf1c3a3eff0e33a8eb74917522f2559075ff8d2fea780a1ae", size = 137598, upload-time = "2026-10-20T02:24:16.604Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/ef/2f/c5464532e965badff2f4c4c1a3a83f5697f0d7c407ed0cda44aaa99bb451/certifi-2026.6.17-py3-none-any.whl", hash = "sha256:2227dcbaafe0d2f59279d1762ddddc37783ed4354594f194ffc31d20f41fc3db", size = 133289, upload-time = "2026-06-17T10:31:06.348Z" },+ { url = "https://files.pythonhosted.org/packages/c4/51/29046e48f693c54e5b7412216d447a1d8362c9653148d98c02cdf65fa733/certifi-2026.10.19-py3-none-any.whl", hash = "sha256:42d35340cc5b9ba78e818ddbff0c5b1c2b779de448a340fd1b989f5fa8670e1b", size = 136464, upload-time = "2026-10-20T02:24:15.072Z" },][[package]]@@ -1019,12 +1020,14 @@ dependencies = [[package.optional-dependencies]anthropic = [{ name = "anthropic" },+ { name = "certifi" },]apps = [{ name = "prefab-ui" },]azure = [{ name = "azure-identity" },+ { name = "certifi" },{ name = "pyjwt" },]client = [@@ -1041,6 +1044,7 @@ code-mode = [{ name = "pydantic-monty" },]gemini = [+ { name = "certifi" },{ name = "google-genai" },{ name = "jsonref" },]@@ -1055,11 +1059,13 @@ mcp = [{ name = "starlette" },]openai = [+ { name = "certifi" },{ name = "openai" },]server = [{ name = "authlib" },{ name = "beartype", version = "0.23.0rc2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" },+ { name = "certifi" },{ name = "cyclopts" },{ name = "exceptiongroup" },{ name = "griffelib" },@@ -1090,6 +1096,11 @@ requires-dist = [{ name = "azure-identity", marker = "extra == 'azure'", specifier = ">=1.16.0" },{ name = "beartype", marker = "python_full_version >= '3.15' and extra == 'client'", specifier = ">=0.23.0rc2" },{ name = "beartype", marker = "python_full_version >= '3.15' and extra == 'server'", specifier = ">=0.23.0rc2" },+ { name = "certifi", marker = "extra == 'anthropic'", specifier = ">=2026.10.19" },+ { name = "certifi", marker = "extra == 'azure'", specifier = ">=2026.10.19" },+ { name = "certifi", marker = "extra == 'gemini'", specifier = ">=2026.10.19" },+ { name = "certifi", marker = "extra == 'openai'", specifier = ">=2026.10.19" },+ { name = "certifi", marker = "extra == 'server'", specifier = ">=2026.10.19" },{ name = "cyclopts", marker = "extra == 'server'", specifier = ">=4.0.0" },{ name = "exceptiongroup", marker = "extra == 'client'", specifier = ">=1.2.2" },{ name = "exceptiongroup", marker = "extra == 'mcp'", specifier = ">=1.2.2" },