An open redirect occurs when the software normalizes the HTTP Location header to include the request hostname. The process involves parsing the redirect URL using Python's `urllib.parse` and joining it to the base URL. Because `urlsplit` (called internally by `urljoin`) treats a `//` at the start of a string as a URI without a scheme, it interprets the subsequent part as the hostname, replacing the original request hostname.
Although a previous attempt was made to mitigate this by replacing `//` with `/%2f`, Python 3.10 and later versions of `urlsplit` internally strip ASCII tab, carriage return, and newline characters. Consequently, a string such as `/t/attacker.com` is converted to `//attacker.com`, bypassing the previous fix and allowing redirection to an external domain.