python-utcp icon indicating copy to clipboard operation
python-utcp copied to clipboard

Security updates

Open h3xxit opened this issue 5 months ago • 0 comments

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 for http:///ws://.
    • Add safe_request_with_redirects for manual discovery, tool calls, and OAuth2; disable redirects for SSE/streaming and gql transport.
    • Validate OAuth2 token_url at 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.
  • Dependencies

    • Bump utcp-http to 1.1.4, utcp-gql to 1.1.1, utcp-websocket to 1.1.1.
    • Add aiohttp>=3.8 to utcp-gql.

Written for commit fc3268e2a62e1181f91a63faf0a9bcee7639db29. Summary will update on new commits.

Review in cubic

h3xxit avatar Jun 14 '26 12:06 h3xxit