Security Issue: Insecure Default Configuration
File:src/mcp/server/transport_security.pylines 40–41
Issue:TransportSecurityMiddleware disables DNS rebinding protection by default:
# If not specified, disable DNS rebinding protection by default for backwards compatibilityself.settings=settingsorTransportSecuritySettings(enable_dns_rebinding_protection=False)
Developers following official examples and tutorials do not pass security_settings — they deploy without DNS rebinding protection.
Impact
An attacker on the same network (coffee shop Wi-Fi, corporate network) can:
- Serve a malicious webpage with DNS rebinding payload
- Connect attacker JS to victim's local MCP server (bypasses same-origin)
- Invoke any registered MCP tool — file reads, shell commands, API calls
Recommended Fix
Change the default to secure-by-default:
def__init__(self, settings: TransportSecuritySettings|None=None):
# Secure by defaultself.settings=settingsorTransportSecuritySettings(enable_dns_rebinding_protection=True)
Provide explicit opt-out for backwards compatibility.
Reported by @hhhashexe · SkillFence Security
Security Issue: Insecure Default Configuration
File:
src/mcp/server/transport_security.pylines 40–41Issue:
TransportSecurityMiddlewaredisables DNS rebinding protection by default:Developers following official examples and tutorials do not pass
security_settings— they deploy without DNS rebinding protection.Impact
An attacker on the same network (coffee shop Wi-Fi, corporate network) can:
Recommended Fix
Change the default to secure-by-default:
Provide explicit opt-out for backwards compatibility.
Reported by @hhhashexe · SkillFence Security