Skip to content

BUG: TrustedProxiesMiddleware truncates IPv6 addresses after first colon #3484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
gradinarufelix opened this issue Jun 10, 2025 · 0 comments
Open
1 task done
Labels

Comments

@gradinarufelix
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Only the substring before the first colon is retained, producing 2a04.

Expected Behavior

The full IPv6 address (e.g. 2a04:f28:1:1234:5678:9abc:def0:1234) is preserved.

Steps To Reproduce

  1. Deploy Flow with a trusted reverse-proxy setup.
  2. Send an HTTP request from an IPv6 client (curl -H "X-Forwarded-For: 2a04:f28::1337" …).
  3. Add additional logging to TrustedProxiesMiddleware
  4. Check the middleware log: the address is truncated to 2a04.

Environment

- Flow: 8.3.14
- PHP: 8.3

Anything else?

The root cause appears to be this line, which naïvely splits on the first : assuming a port delimiter:

https://github.com/neos/flow/blob/137c9d44802e173fb18c79ef2037a0a74995bbe2/Classes/Http/Middleware/TrustedProxiesMiddleware.php#L277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant