Repository navigation
packages/ak-axum/extract/client_ip: use the leftmost X-Forwarded-For IP - #26353
Conversation
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26353 +/- ##
==========================================
- Coverage 92.11% 92.07% -0.04%
==========================================
Files 1175 1175
Lines 76724 76724
Branches 4121 4121
==========================================
- Hits 70672 70647 -25
- Misses 5999 6024 +25
Partials 53 53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Playwright e2eDownload this run's HTML report, traces and server logs, then open the report: gh run download 35748633301 -D playwright-artifacts
npx playwright show-report playwright-artifacts/playwright-reportInstallation instructionsInstructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-bdb44e6656c5b242c3ab2b709e52143829cc61cd
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-bdb44e6656c5b242c3ab2b709e52143829cc61cdAfterwards, run the upgrade commands from the latest release notes. |
|
🍒 Cherry-pick to |
…IP (cherry-pick #26353 to version-2026.8) (#26356) Co-authored-by: Marc 'risson' Schmitt <[email protected]> Signed-off-by: Marc 'risson' Schmitt <[email protected]>
…able (#203) authentik 2026.8.4 (live since 2026-10-17) takes the leftmost X-Forwarded-For entry whenever its peer is a trusted proxy (goauthentik/authentik#26353; reported upstream as #26941). Cloudflare keeps a client-supplied XFF and only appends the real IP. authentik therefore received "<forged>,<real>,<cloudflared pod>" and recorded the forged IP. Verified live: an internet request through Cloudflare with "X-Forwarded-For: 192.0.2.21" was logged as remote=192.0.2.21. That IP feeds events, the reputation policy, ak_client_ip expression policies and GeoIP. 2026.8.3 already got the LAN-direct case wrong: authentik trusts 192.168.0.0/16 by default and skipped the LAN peer that Envoy appended. The authentik route now overwrites X-Forwarded-For with %DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%. That is the client IP Envoy already resolves via the ClientTrafficPolicy (trustedCIDRs 10.42.0.0/16), so authentik gets a single, correct entry whatever selection rule it uses. Validated on envoy distroless-v1.39.1 (same as live) with a replica of the live listener config: forged, normal, IPv6 and LAN-direct requests all yield the real client IP. Envoy Gateway v1.9.2 passes the value through verbatim, and a server-side dry-run accepts the route. Co-authored-by: cypr0 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
closes #25811