Files
Rahul selvaraj 5ea8fa1ebc fix(mcp): let operators declare Fake-IP ranges for self-service servers (#2857)
* fix(mcp): let operators declare Fake-IP ranges for self-service servers

A local proxy in Fake-IP mode (Loon, Clash, Surge) answers DNS for public
hostnames with synthetic private addresses, e.g. fd27:712::/32 from Loon,
and routes the connection by hostname. Strict validation then rejects
public MCP Store entries such as GitMCP as private-network targets.

Add DEEPTUTOR_MCP_FAKE_IP_RANGES (comma separated CIDRs, opt-in, read from
the process environment). In strict mode an address a hostname resolves to
inside a declared range is no longer rejected as private. IP-literal URLs,
loopback and the link-local/metadata ranges stay blocked regardless, and
any other private answer for the same host still fails validation.

Closes #2789

Assisted-by: Claude <noreply@anthropic.com>

* fix(mcp): warn on Fake-IP opt-in and document single-user SSRF trade-offs

Address review feedback from JinhangHE126 on #2857:
Document clearly that DEEPTUTOR_MCP_FAKE_IP_RANGES relaxes hostname-based SSRF protection for hostnames resolving into declared ranges (as the proxy resolves targets and connects).
Emit a startup security warning when DEEPTUTOR_MCP_FAKE_IP_RANGES is set, noting that the setting is intended strictly for single-user/desktop installations.

Assisted-by: Gemini (Google Vertex AI)
2026-12-01 10:32:50 +08:00
..
2026-07-31 00:25:48 +08:00