Summary
MCP SSE and Streamable HTTP transports (src/agentos/mcp/sse.py, src/agentos/mcp/streamable_http.py) connect to MCPServerConfig.url via httpx with no SSRF validation. Every other URL-fetching path (web_fetch, http_request, skill-hub) calls validate_http_url_for_fetch() before connecting — the MCP transport skips this entirely.
Impact
Cloud metadata endpoints (169.254.169.254), private ranges, and unsupported schemes are reachable through MCP server config. An attacker who controls or injects the MCP server URL can exfiltrate instance credentials or redirect agent traffic to internal hosts.
Suggested fix
Call validate_http_url_for_fetch(self.config.url) in both MCPSSEClient.connect() and StreamableHttpTransport.connect() before creating the httpx client. This is the same guard used by web_fetch and http_request.
Suggested labels: type: security, type: bug, area: mcp
Summary
MCP SSE and Streamable HTTP transports (
src/agentos/mcp/sse.py,src/agentos/mcp/streamable_http.py) connect toMCPServerConfig.urlvia httpx with no SSRF validation. Every other URL-fetching path (web_fetch,http_request, skill-hub) callsvalidate_http_url_for_fetch()before connecting — the MCP transport skips this entirely.Impact
Cloud metadata endpoints (169.254.169.254), private ranges, and unsupported schemes are reachable through MCP server config. An attacker who controls or injects the MCP server URL can exfiltrate instance credentials or redirect agent traffic to internal hosts.
Suggested fix
Call
validate_http_url_for_fetch(self.config.url)in bothMCPSSEClient.connect()andStreamableHttpTransport.connect()before creating the httpx client. This is the same guard used byweb_fetchandhttp_request.Suggested labels: type: security, type: bug, area: mcp