gh-87389: Fix an open redirection vulnerability in http.server. (GH-93879) (GH-94093)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 22 Jun 2022 08:42:02 +0000 (01:42 -0700)
committerSean Whitton <spwhitton@spwhitton.name>
Thu, 20 Mar 2025 02:07:39 +0000 (10:07 +0800)
commit15be59ef0a33b3a05136bcf779612133f456b341
tree3b83e5de4ddd49b4988da692b477ee25675cc5dd
parent4c2cc8f23266a496e2fd5e46ab56428d39e2f174
gh-87389: Fix an open redirection vulnerability in http.server. (GH-93879) (GH-94093)

Fix an open redirection vulnerability in the `http.server` module when
an URI path starts with `//` that could produce a 301 Location header
with a misleading target.  Vulnerability discovered, and logic fix
proposed, by Hamza Avvan (@hamzaavvan).

Test and comments authored by Gregory P. Smith [Google].
(cherry picked from commit 4abab6b603dd38bec1168e9a37c40a48ec89508e)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Gbp-Pq: Name 0008-gh-87389-Fix-an-open-redirection-vulnerability-in-ht.patch
Lib/http/server.py
Lib/test/test_httpservers.py