Broker front hides the peer: POST /v1/reachability/self dials 127.0.0.1, so the self-probe never observes the caller's line (GOTCHAS #250) #2010
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#2010
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observed 2026-09-29 from a home laptop (Colombia, 177.255.202.2):
The route reads
RemoteAddr(by design — ADR 0253: never a caller-supplied header, or it becomes an open dialer). Behind the broker's reverse proxy that peer is the proxy's loopback, so the broker dials itself and reportsopenfor every caller. GOTCHAS #250 names the fix: the front must preserve the real peer (the PROXY protocol between the proxy and the broker), never X-Forwarded-For.Why it matters now:
cmd/gateway-check(the pre-founding checker, built 2026-09-29 onsession/gateway-check) is the first consumer. It compares the observedaddresswith the machine's OpenDNS address and honestly reports outside-in unproven on a mismatch — so today no operator can get an outside-in answer, and founding's Connect-section check (DDR 0240) inherits the same blind spot when it moves onto this route.Ask (Ben): this is a security-posture change on a deployed Matou service (ADR 0174 §3) — rule the PROXY-protocol front (Caddy
servers { listener_wrappers { proxy_protocol } }on the broker's listener, or the equivalent for whatever fronts it), and whether the broker should REFUSE to probe a loopback/privateRemoteAddr(it is never a real caller) rather than dial it.Acceptance: the curl above from a home line returns that line's public address;
gateway-checkon a machine with 80/443 forwarded reads✓ visitors … your port forwarding works.Ruled by Ben 2026-10-05 ("I want the tool to answer itself") — BUILT, on main as
f2a9f1c7(2026-10-06).broker/internal/proxyproto: withBROKER_PROXY_PROTOCOL=1every accepted connection must open with a PROXY protocol v2 header (what Caddy'stransport http { proxy_protocol v2 }sends) and the header's source becomesRemoteAddr; a header-less connection is dropped, never served. NoX-Forwarded-Foris read (ADR 0253 holds). Note: the Caddy syntax in this ticket's body (listener_wrappers { proxy_protocol }) is the wrong direction — that is Caddy receiving PROXY; the fix needs Caddy sending it to the upstream.Cutover (hands-on, root on the mail droplet — the rail cannot change Caddy): the push deploys the new binary with the switch OFF (unchanged behaviour). Then, in ONE step because either half alone breaks every request, run the staged
/tmp/proxy-protocol-cutover.sh(alsoscripts/broker/proxy-protocol-cutover.shin the repo;--revertundoes it). It refuses to run until the installed binary knows the switch.Acceptance:
curl -sX POST https://broker.idss.nz/v1/reachability/selffrom a home line answers that line's public address;gateway-check(now also asking the router to forward 80/443 with consent —Matou/gateway-checkd151917) reads✓ visitors … your port forwarding workson a forwarded machine.Cutover done by Ben 2026-10-07 05:49Z — acceptance met.
The address is the caller's own (= OpenDNS's view of that line) and the verdict is honest (CGNAT). Caddy vhost carries
transport http { proxy_protocol v2 };/v1/gateways/offerand the rest still 200. GOTCHAS #250 closing note on main. Closing.