X-Forwarded-For Proxy Fix does a host.split(":", 1)[1]. This does not work with IPv6 addresses using : separator.
For example splitting [fd00', 'fd00:fd00:0000::2]:13050/ would result in: ['[fd00', 'fd00:fd00:0000::2]:13050/'] and host is incorrectly set to [fd00' i.e only the first hextet of the IPv6 address.
[1] https://github.com/pallets/werkzeug/blob/main/src/werkzeug/middleware/proxy_fix.py#L176
Environment:
- Python version: Python 3.6.8
- Werkzeug version: python3-werkzeug-2.0.1-2.el8.noarch
X-Forwarded-For Proxy Fix does a
host.split(":", 1)[1]. This does not work with IPv6 addresses using:separator.For example splitting
[fd00', 'fd00:fd00:0000::2]:13050/would result in:['[fd00', 'fd00:fd00:0000::2]:13050/']andhostis incorrectly set to[fd00'i.e only the first hextet of the IPv6 address.[1] https://github.com/pallets/werkzeug/blob/main/src/werkzeug/middleware/proxy_fix.py#L176
Environment: