python-utcp
python-utcp copied to clipboard
Security updates
Summary by cubic
Hardened network security across HTTP, GraphQL, and WebSocket protocols to block SSRF and MITM. Enforces secure URL schemes, validates each redirect hop, and checks OAuth2 token URLs; adds tests and minor version bumps.
-
Bug Fixes
- Replace prefix checks with hostname-based validators: allow
https:///wss://, and only loopback forhttp:///ws://. - Add
safe_request_with_redirectsfor manual discovery, tool calls, and OAuth2; disable redirects for SSE/streaming andgqltransport. - Validate OAuth2
token_urlat runtime and during OpenAPI conversion; reject internal or plain-HTTP non-loopback URLs. - WebSocket now enforces “WSS or loopback” and blocks upgrade redirects.
- New tests cover redirect chains, token URL validation, and localhost-prefix bypass.
- Replace prefix checks with hostname-based validators: allow
-
Dependencies
- Bump
utcp-httpto 1.1.4,utcp-gqlto 1.1.1,utcp-websocketto 1.1.1. - Add
aiohttp>=3.8toutcp-gql.
- Bump
Written for commit fc3268e2a62e1181f91a63faf0a9bcee7639db29. Summary will update on new commits.