2 Commits

Author SHA1 Message Date
courtmanr@gmail.com
3a75b0d746 Tighten local-client trust and forwarded client addresses
Loopback trust (no-auth access, recovery tokens and sessions,
unauthenticated config transfer, the rate-limit exemption) now needs more
than a loopback peer: no reverse-proxy forwarding header, a Host that is
localhost, *.localhost or a loopback literal, and a browser request that is
same-origin by Fetch Metadata or names exactly this origin. A same-host
proxy passing a public Host, a page whose name resolves to 127.0.0.1, or a
page on another origin no longer counts as a local user.

GetClientIP now takes the right-most X-Forwarded-For hop that is not in
PULSE_TRUSTED_PROXY_CIDRS, reading every header line and accepting entries
with ports, instead of the first entry. A proxy that appends keeps the
client's own entries on the left, so the first entry is client-chosen.
Lockout, rate limits, audit addresses and recovery-token binding use this.

The reverse-proxy guide explains multi-hop setups: list upstream hops as
trusted or have the final proxy replace the header.
2026-11-13 22:35:24 +00:00
rcourtman
586473ee31 Bind recovery and bootstrap auth to direct loopback 2026-04-22 00:39:53 +01:00