Skip to content

v2.1.1: fix: reject an upstream that points at a managed local port

Choose a tag to compare

@debbide debbide released this 15 Sep 23:35
· 4 commits to master since this release
A node whose upstream resolves to one of our own managed ports forwards into
itself. A self-reference, a two-node A<->B cycle and a three-node cycle all
spin at roughly 1700 connections per second, pinning the CPU until the request
times out, and the port stays saturated for a while afterwards.

start() only validated the URI format, so nothing stopped this. Restore the
check that was dropped in b4688d7, this time reporting it as a 400 with a
readable reason instead of a generic error, so the panel can show why the node
refused to start.

Only local addresses (localhost, 127.0.0.0/8, ::1) that land on a managed port
are refused. Remote upstreams and unrelated local ports such as a separate
proxy on 1080 are unaffected. Because the check lives in start(), restore()
applies it on boot too, so an already-broken row cannot restart the loop.