You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: an MCP URL with an unencodable host escapes mcp_validator as a raw UnicodeError (likely 500) #3909
validate_mcp_config lets a raw UnicodeError escape for an MCP server URL whose host the idna codec refuses (an empty label such as https://a..example.com/mcp, or a label over 63 characters). The credentials route catches only McpValidationError, so the request most likely returns 500 instead of a named 400. It fails closed: nothing is fetched.
Where
src/backend/services/mcp_validator.py ~line 307 catches only socket.gaierror around getaddrinfo; CPython's getaddrinfo raises UnicodeError from its own idna encode before any lookup.
The vendored mirror docker/base-image/agent_server/mcp_validator.py ~line 307 has the same code (Invariant Setup improvements #5, byte-identical, parity-tested).
src/backend/routers/credentials.py ~line 393 catches only McpValidationError.
Same class as #3322, which fixed it in utils/url_validation.py. Found while reviewing #3906.
Acceptance Criteria
An unencodable MCP host is refused with an McpValidationError and a 400, in both copies of mcp_validator.py.
The two copies stay byte-identical (parity test green).
Unit test covers https://a..example.com/mcp and a 64-character label.
Activity
fix(mcp-validator): refuse an unencodable MCP host instead of raising…