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

security fix

Open h3xxit opened this issue 5 months ago • 0 comments

Summary by cubic

Hardens redirect handling and OAuth2 token URL validation in @utcp/http to prevent SSRF and credential exfiltration. Every redirect hop is revalidated; streaming/SSE handshakes no longer follow redirects.

  • Bug Fixes

    • Added safeRequestWithRedirects and used it for manual discovery, tool calls, and OAuth2 token fetches.
    • Validated OAuth2 token_url at runtime and in OpenApiConverter; rejects plain HTTP and internal/metadata hosts.
    • Set redirect: 'error' for SSE and streaming HTTP to refuse handshake redirects.
    • Added tests to pin redirect and token URL behavior.
  • Dependencies

    • Bumped @utcp/http to 1.1.4.

Written for commit 613a878938cb90fddcf929f0b30a9b7ebad4377f. Summary will update on new commits.

Review in cubic

h3xxit avatar Jun 14 '26 12:06 h3xxit