Skip to content

Warn when HMAC is used over plain HTTP to a non-loopback host #237

Closed

Description

@MarTrepodi

Component

SwgohComlink / SwgohComlinkAsync (clients)

Problem or Use Case

HMAC signing proves who sent a request. It does not protect the response, and it does not stop a request from being replayed. Over http:// to a remote host, an attacker on the network path can change responses in transit and replay signed requests within the server's X-Date window. Today the client accepts this setup silently.

Proposed Solution

When HMAC is on, the URL scheme is http, and the host is not a loopback address, emit one logger.warning per client. Loopback covers localhost, 127.0.0.0/8 and ::1, checked with ipaddress when the host is a literal IP. The connection is never blocked.

Acceptance

  • The warning fires for http://comlink.example.com with keys set.
  • No warning for http://localhost, http://127.0.0.1, any https:// URL, or a client without keys.
  • docs/index.md gains a paragraph recommending TLS or a private network for a remote Comlink.

Alternatives Considered

  • Refuse the connection. Too disruptive: many deployments use HMAC on a trusted LAN over plain HTTP.
  • Also exempt private ranges (RFC 1918). Not proposed: a hostname such as comlink.lab can't be classified without a DNS lookup, and a LAN is not automatically trusted.

Activity

  1. added
    enhancement
    on Nov 7, 2026
  2. github-actions commented on Nov 7, 2026

    @github-actions
    Contributor

    Addressed by #258, which is now merged into develop. This issue will close automatically when that change is released to main.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions