security fixes

Merged
H3
5mo ago
+280-44

Summary by cubic

Hardened redirect and header handling across http, gql, and websocket to prevent credential leaks and header injection. Custom auth headers are now stripped on cross‑origin redirects, and CR/LF in header names is rejected.

  • Bug Fixes

    • Strip caller-declared auth headers on cross-origin redirects via new auth_header_names threaded from _apply_auth (covers ApiKeyAuth custom header names and Authorization for OAuth2).
    • Preserve headers on same-origin redirects; added tests to pin behavior.
    • Reject CR/LF in attacker-controlled header fields (e.g., ApiKeyAuth.var_name) to block HTTP header injection in HTTP/SSE/streamable HTTP paths.
    • Implemented in safe_request_with_redirects for utcp-http, utcp-gql, and utcp-websocket; new param is internal-only and not sent on the wire.
  • Dependencies

    • Bump utcp-http to 1.1.7, utcp-gql to 1.1.4, utcp-websocket to 1.1.4.