An unauthenticated remote attacker can set `conn.host` and `conn.port` to values that violate the RFC 3986 host grammar by using the authority of an HTTP/1 absolute-form or authority-form request target. While the software validates the `Host` header and returns a 400 error if it is malformed, the authority within the request target takes precedence per RFC 9112. The function `determine host and port!/4` in `lib/bandit/pipeline.ex` passes this authority to the application without validation.
This allows the injection of NUL, DEL, and non-ASCII bytes, invalid IP literals, and ports outside the 1..65535 range. Applications that construct absolute URLs using `conn.host`, such as through `Plug.Conn.request url/1` or Phoenix URL helpers, may emit links with an attacker-controlled authority. For `CONNECT` requests, the unparsed port string is placed in `conn.port`, which may cause `Plug.Conn.request url/1` to raise an error as `Plug.Conn.port number/0` expects an integer.