Skip to content

Comments

fix: enforce HTTPS in ResilientHttpClient to prevent cleartext credential transmission (CWE-319)#185

Open
quangtran88 wants to merge 1 commit intoConway-Research:mainfrom
quangtran88:fix/https-enforcement
Open

fix: enforce HTTPS in ResilientHttpClient to prevent cleartext credential transmission (CWE-319)#185
quangtran88 wants to merge 1 commit intoConway-Research:mainfrom
quangtran88:fix/https-enforcement

Conversation

@quangtran88
Copy link
Contributor

Summary

Reject non-HTTPS URLs in ResilientHttpClient.request() to prevent API keys and other credentials from being transmitted in cleartext.

Changes

  • Add URL protocol validation at the top of request() before any network I/O
  • Reject URLs with protocol other than https:, with an exception for localhost and 127.0.0.1 for local development
  • Throws a descriptive error: Refusing to send request over insecure protocol: http: (use HTTPS)

Security Impact

The ResilientHttpClient previously accepted any URL protocol. Since it's used for all Conway API calls — which include the API key in the Authorization header — an http:// URL would transmit credentials in cleartext, exposing them to network-level attackers (MITM, packet sniffing).

Test Compatibility

All existing tests already use https:// URLs — no test changes required.

Closes #182

…tial transmission (CWE-319)

Reject non-HTTPS URLs in the request method, with an exception for
localhost/127.0.0.1 for local development. Prevents API keys sent in
Authorization headers from being transmitted in cleartext.

Closes Conway-Research#182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: No HTTPS enforcement in HTTP client (CWE-319)

1 participant