Security updates
Merged
H3
5mo ago+2817+2817+0123456789012345678901234567890123456789-90-90-01234567890123456789
Summary by cubic
Post‑audit hardening for HTTP, GraphQL, and WebSocket to block SSRF and credential leaks. Tightens URL/loopback checks, secures redirects and OAuth2 token handling (incl. relative token URLs), patches GraphQL introspection, and hardens WebSocket message templating; adds tests and bumps versions.
-
Bug Fixes
- Broaden loopback detection and replace prefix checks with hostname/IP validators:
https:///wss://allowed;http:///ws://loopback only (covers0.0.0.0,::, full127.0.0.0/8, IPv4‑mapped IPv6). - Harden redirects via
safe_request_with_redirects: strip auth‑like headers, request body, and proxy creds on cross‑origin; normalize default ports for same‑origin; used for manual discovery, tool calls, OAuth2 across HTTP/SSE/WS. - Validate OAuth2
token_urlat runtime and during OpenAPI conversion; resolve relativetokenUrlagainstspec_urland validate. - GraphQL: disable redirects before schema introspection so the first request is protected.
- WebSocket: enforce “WSS or loopback” with hostname validators, remove invalid redirect flag, and escape JSON‑shaped string templates to prevent injection.
- SSE: ensure
ClientSessioncloses on success to prevent leaks.
- Broaden loopback detection and replace prefix checks with hostname/IP validators:
-
Dependencies
- Bump
utcp-httpto 1.1.6,utcp-gqlto 1.1.3,utcp-websocketto 1.1.3. - Add
aiohttp>=3.8toutcp-gql.
- Bump