Skip to content

[bug] Prevent MDBList API keys leaking through transport errors #692

Closed

Description

@Quick104

What happened

The MDBList client places apikey in the request query string and wraps the raw error returned by http.Client.Do.

Go transport errors include the request URL. The current MDBList discovery and connection-check handlers interpolate those errors into API responses, so a DNS, TLS, timeout, or connection failure can return the configured MDBList API key to the caller. The same error is unsafe to record under a generic log attribute because Silo's redactor is key-based and does not inspect arbitrary error text.

Relevant paths:

  • internal/mdblist/discovery.go
  • internal/api/handlers/user_collection_imports.go
  • internal/api/handlers/admin_settings_checks.go
  • internal/logredact/redact.go

Expected behavior

No MDBList credential or credential-bearing URL may appear in an error value, API response, application log, operational log, or telemetry export.

Acceptance criteria

  • MDBList transport errors are converted to credential-free errors before leaving the client package.
  • Search, Top, Check, and future title-rating methods use the same safe error path.
  • User collection discovery and the admin connection check return useful but generic failure messages.
  • Tests inject a transport error using a sentinel API key and prove that the key is absent from:
    • the returned client error;
    • serialized HTTP responses;
    • any log record produced by the affected path.
  • HTTP status and retry classification remain useful without exposing the URL.
  • Tests cover DNS/connection-style errors and context timeout/cancellation.

Scope

This issue covers credential-safe MDBList error handling only. It does not add title-rating lookup, Rotten Tomatoes backfill, or Jellyfin mapping.

Discovery context

Found while reviewing Silo Server PR #266 at exact head 83623def9f8eebfd9f8a7dd3b9defd5ba9b1c1a1. The unsafe discovery-client behavior also exists on current main; it is not limited to that PR.

AI Disclosure

  • Tool: Codex in T3 Code
  • Model: gpt-5.6-sol
  • Involvement: AI-assisted investigation and issue drafting, published with maintainer approval
  • Adversarial review: Traced the credential from URL construction through Go's transport error to both HTTP response sinks and Silo's key-based log-redaction boundary.

Activity

  1. added
    bug
    triaged
    and removed
    triaged
    on Sep 20, 2026
  2. added theissue type on Sep 20, 2026
  3. removed
    bug
    on Sep 20, 2026
  4. added a commit that references this issue on Oct 13, 2026
    3280a88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions