All checks were successful
check / check (push) Successful in 4m9s
The chain walk in the rate-limit key function had no bound on hop count. It runs whenever the direct peer is a trusted proxy, which is the normal production deployment, so any client could pad X-Forwarded-For to MaxHeaderBytes (~50k hops, ~0.9 MB) and make the key function walk all of it on the unauthenticated receiver endpoint before the request was rate-limited. Only the last 64 entries are examined now; real chains are one to three hops. A chain longer than the cap runs out of hops and falls back to the peer address, the same fail-closed direction an unreadable hop already took. Bucket assignment for real chains is unchanged. Also corrects the comment on the unparseable-RemoteAddr fallback: it claimed keying on the raw value avoids collapsing those peers into one bucket, but on a Unix-socket listener every peer carries the same RemoteAddr and does share one bucket. The behaviour is fail-closed and unchanged; only the comment was wrong.
16 KiB
16 KiB