fastmcp/docs
Alexander Savchuk 2899ffb6f3
Fix #4292: SSRF guard breaks OAuth/JWKS fetches behind a corporate HTTP proxy (#4412)
* Add FASTMCP_SSRF_TRUST_PROXY to allow SSRF fetches through a corporate proxy

🤖 Generated with Claude Code

* Make SSRF fetch client trust_env explicit for proxy routing

🤖 Generated with Claude Code

* Warn when SSRF proxy trust is enabled without a configured proxy

🤖 Generated with Claude Code

* Warn when NO_PROXY would send an SSRF-trust-proxy fetch direct

🤖 Generated with Claude Code

* Refuse SSRF-trust-proxy fetches when no proxy would route the target

🤖 Generated with Claude Code

* Fix TestProxyMode mocks to patch httpx2.AsyncClient

main's httpx -> httpx2 migration (#4503) landed after these tests were
written; ssrf.py's fetch path already uses httpx2.AsyncClient, but
TestProxyMode still patched the old httpx module, so the mock silently
stopped intercepting and requests escaped to the real network.

* Fix port-qualified NO_PROXY bypass in SSRF proxy-trust guard

proxy_bypass(hostname) discarded the port, so a NO_PROXY entry like
127.0.0.1:8443 went undetected while httpx2 honored it and sent the
request direct with the blocklist already disabled. Pass host:port
instead, except for IPv6 literals, where httpx2 ignores port when
matching NO_PROXY and neither bracketed nor unbracketed host:port
reliably matches through proxy_bypass()'s own parser.

* Replace NO_PROXY prediction with explicit proxy control in SSRF trust-proxy mode

Predicting httpx2's proxy routing (via proxy_bypass(), then via httpx2's own
get_environment_proxies()/URLPattern internals) kept diverging from its real
NO_PROXY handling — three rounds, three different divergences, always in the
unsafe direction. Read HTTPS_PROXY/ALL_PROXY directly and pass it to httpx2
explicitly with trust_env=False, so the request provably goes through that
proxy instead of being predicted to. NO_PROXY is no longer evaluated in this
mode: a NO_PROXY'd host is now routed through the proxy rather than refused,
since that's strictly safer than the alternative (direct with the blocklist
already off).

---------

Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2026-07-18 21:42:52 -04:00
..
.cursor/rules Clean up parameter documentation 2025-06-22 20:59:53 -04:00
apps Remove deprecated fastmcp.server.apps / server.app shims (3.2) 2026-07-07 07:53:10 -04:00
assets Animated (#3231) 2026-02-19 11:56:51 -05:00
cli Add fastmcp-remote bridge package (#4208) 2026-05-23 10:04:21 -04:00
clients Migrate to MCP SDK v2.0.0b2 (httpx2) (#4503) 2026-07-18 15:12:47 -04:00
community Normalize repo references to PrefectHQ/fastmcp casing (#3218) 2026-02-18 14:51:18 -05:00
css Restore Mintlify's fixed banner positioning (#4542) 2026-07-18 21:25:39 -04:00
deployment Forward-port HTTP host guard compatibility (#4474) 2026-07-08 20:55:56 -04:00
development Fix typos (#4498) 2026-07-18 21:18:39 -04:00
getting-started Migrate to MCP SDK v2.0.0b2 (httpx2) (#4503) 2026-07-18 15:12:47 -04:00
integrations Fix typos (#4498) 2026-07-18 21:18:39 -04:00
more Fix #4292: SSRF guard breaks OAuth/JWKS fetches behind a corporate HTTP proxy (#4412) 2026-07-18 21:42:52 -04:00
patterns Add fastmcp-slim for client-only installs (#4122) 2026-05-11 17:13:21 -04:00
public/schemas/fastmcp.json chore: Update fastmcp.json schema (#1955) 2025-09-29 20:12:24 -04:00
python-sdk chore: Update SDK documentation (#4427) 2026-07-05 19:16:03 -04:00
servers Add 4.0.0 version badge to Path Security section (#4540) 2026-07-18 20:58:32 -04:00
snippets Fix docs app demo iframe assets (#4194) 2026-05-20 13:18:45 -04:00
tutorials Migrate to MCP SDK v2.0.0b2 (httpx2) (#4503) 2026-07-18 15:12:47 -04:00
v2 Fix typos (#4498) 2026-07-18 21:18:39 -04:00
.ccignore Add comprehensive OAuth 2.1 authentication system with WorkOS integration (#1327) 2025-08-01 17:06:55 -04:00
changelog.mdx Fix typos (#4498) 2026-07-18 21:18:39 -04:00
docs.json Add server-side identity assertion (SEP-990 ID-JAG) (#4483) 2026-07-18 19:52:15 -04:00
fastmcp-analytics.js [codex] Add FastMCP docs telemetry (#3727) 2026-03-31 19:32:09 -04:00
prefab-demo-payloads.js Fix docs app demo iframe assets (#4194) 2026-05-20 13:18:45 -04:00
python-sdk-pages.json chore: Update SDK documentation (#4360) 2026-06-27 10:36:03 -04:00
unify-intent.js Add tag to deployment pages (#3624) 2026-03-25 11:39:25 -04:00
updates.mdx Docs: forward-port v3.4.4 changelog entries (#4476) 2026-07-08 20:55:43 -04:00
v2-banner.js Update docs for 3.0 GA release (#3216) 2026-02-18 14:29:28 -05:00
v2-navigation.json chore: split v2 docs navigation into separate file (#3762) 2026-04-04 21:17:39 -04:00