Skip to content

Enforce HTTPS for credential-bearing provider health checks #2376

Description

@coderabbitai

Summary

Require HTTPS before any provider health check sends an API key, bearer token, or other credential to a configured endpoint.

Azure OpenAI validation can accept an http:// api_base. The Azure lightweight health check then sends the submitted credential in request headers. An attacker on that network path can read or modify the credential.

Required changes

  • In src/api/provider_validation.py, validate that Azure api_base uses the https scheme before _test_azure_lightweight_health constructs a credential-bearing request.
  • Preserve the existing Azure OpenAI Service and Azure AI Foundry endpoint selection behavior.
  • Review all similar provider health checks and credential-validation probes for endpoints that originate from configuration.
  • For each equivalent request path, reject non-HTTPS endpoints before credentials are sent. Do not change intentionally local, credential-free health checks without a documented reason.

Affected areas

  • src/api/provider_validation.py
  • Other provider health-check and credential-validation modules identified by the audit
  • Unit tests for validation and request construction

Acceptance criteria

  • Azure OpenAI Service and Azure AI Foundry validation reject non-HTTPS api_base values before sending credentials.
  • Existing valid HTTPS Azure endpoint behavior remains unchanged.
  • The audit covers credential-bearing health checks that use configured endpoints.
  • Tests prove that no credential-bearing request is made for rejected HTTP endpoints.
  • Tests cover each additional affected provider path found by the audit.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions