From 64b6d84631d4cfe2ae8134d4be3b58a067f27c0c Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 1 Oct 2026 21:03:04 +0200 Subject: [PATCH] plant-it: remove the client-written X-Forwarded-For chain on its router (R-753) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit leftmost XFF keys its per-IP limiter (an unbounded map). Once traefik trusts the tunnel's fixed address (controller v0.286.0), the leftmost entry is what a stranger writes; with the chain removed the app reads traefik's X-Real-Ip or its peer, as before — never forgeable. Measured on 9202: a router with this middleware receives no X-Forwarded-For (felhom.eu audits/visitors-2026-10-01/A/P1). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- templates/plant-it/docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/plant-it/docker-compose.yml b/templates/plant-it/docker-compose.yml index 7574521..9e616e6 100644 --- a/templates/plant-it/docker-compose.yml +++ b/templates/plant-it/docker-compose.yml @@ -36,6 +36,10 @@ services: labels: - "traefik.enable=true" - "traefik.http.routers.plant-it.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)" + # R-753: this app reads the LEFTMOST X-Forwarded-For entry, which a stranger writes once traefik keeps the + # tunnel's chain — so its chain is removed here (it then reads traefik's X-Real-Ip or peer; never forgeable). + - "traefik.http.middlewares.plant-it-xff.headers.customrequestheaders.X-Forwarded-For=" + - "traefik.http.routers.plant-it.middlewares=plant-it-xff" - "traefik.http.routers.plant-it.entrypoints=websecure" - "traefik.http.routers.plant-it.tls=true" - "traefik.http.routers.plant-it.tls.certresolver=letsencrypt"