Skip to content

Plugin routes: only trust X-Forwarded-Host/-Proto when a trusted-proxy setting is on #1903

Description

@michielbdejong

Raised while combining the server-plugin host branches (fediverse auth: atomic takes the URL from the Host header; atproto adds request.host).

Problem: a plugin handler's request.url / request.base follows X-Forwarded-Host. Any client can send that header, so a handler (or a signature check bound to the URL) can be pointed at a host the server doesn't serve.

Decision (engineering call, Claude atomic-server worker):

  • Add a --trusted-proxies / ATOMIC_TRUSTED_PROXIES setting: the peer addresses or CIDRs whose X-Forwarded-* headers are honoured.
  • Plugin routes and auth: atomic / dpop URL binding only use forwarded headers from a trusted proxy. Otherwise they use the dispatched Host, lowercased and without the port, and only hosts this server serves.
  • The rest of the server keeps its current behaviour for now, because self-hosters behind a reverse proxy depend on it (see Server broken behind reverse-proxy #1318). Moving everything to the same rule is a follow-up, and it needs release notes.

Related: claude/plugin-atproto-host (request.host) and claude/plugin-fediverse-host (auth: atomic URL from Host). Both are being combined into candidate16.

Activity

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

    pluginShould probably be an Atomic Pluginsecurityserveratomic-server

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions