diff -Nru python-urllib3-1.25.8/debian/changelog python-urllib3-1.25.8/debian/changelog --- python-urllib3-1.25.8/debian/changelog 2020-10-01 17:56:51.000000000 +0000 +++ python-urllib3-1.25.8/debian/changelog 2023-01-18 15:50:06.000000000 +0000 @@ -1,3 +1,13 @@ +python-urllib3 (1.25.8-2ubuntu0.2) focal-security; urgency=medium + + * SECURITY UPDATE: DoS via URL regex backtracking + - debian/patches/CVE-2021-33503.patch: improve performance of + sub-authority splitting in URL in src/urllib3/util/url.py, + test/test_util.py. + - CVE-2021-33503 + + -- Marc Deslauriers Wed, 18 Jan 2023 10:50:06 -0500 + python-urllib3 (1.25.8-2ubuntu0.1) focal-security; urgency=medium * SECURITY UPDATE: CRLF injection via method parameter diff -Nru python-urllib3-1.25.8/debian/patches/CVE-2021-33503.patch python-urllib3-1.25.8/debian/patches/CVE-2021-33503.patch --- python-urllib3-1.25.8/debian/patches/CVE-2021-33503.patch 1970-01-01 00:00:00.000000000 +0000 +++ python-urllib3-1.25.8/debian/patches/CVE-2021-33503.patch 2023-01-18 15:49:37.000000000 +0000 @@ -0,0 +1,57 @@ +From 2d4a3fee6de2fa45eb82169361918f759269b4ec Mon Sep 17 00:00:00 2001 +From: Seth Michael Larson +Date: Wed, 26 May 2021 10:43:12 -0500 +Subject: [PATCH] Improve performance of sub-authority splitting in URL + +--- + src/urllib3/util/url.py | 8 +++++--- + test/test_util.py | 10 ++++++++++ + 2 files changed, 15 insertions(+), 3 deletions(-) + +--- a/src/urllib3/util/url.py ++++ b/src/urllib3/util/url.py +@@ -63,12 +63,12 @@ IPV6_ADDRZ_RE = re.compile("^" + IPV6_AD + BRACELESS_IPV6_ADDRZ_RE = re.compile("^" + IPV6_ADDRZ_PAT[2:-2] + "$") + ZONE_ID_RE = re.compile("(" + ZONE_ID_PAT + r")\]$") + +-SUBAUTHORITY_PAT = (u"^(?:(.*)@)?(%s|%s|%s)(?::([0-9]{0,5}))?$") % ( ++_HOST_PORT_PAT = ("^(%s|%s|%s)(?::([0-9]{0,5}))?$") % ( + REG_NAME_PAT, + IPV4_PAT, + IPV6_ADDRZ_PAT, + ) +-SUBAUTHORITY_RE = re.compile(SUBAUTHORITY_PAT, re.UNICODE | re.DOTALL) ++_HOST_PORT_RE = re.compile(_HOST_PORT_PAT, re.UNICODE | re.DOTALL) + + UNRESERVED_CHARS = set( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-~" +@@ -365,7 +365,9 @@ def parse_url(url): + scheme = scheme.lower() + + if authority: +- auth, host, port = SUBAUTHORITY_RE.match(authority).groups() ++ auth, _, host_port = authority.rpartition("@") ++ auth = auth or None ++ host, port = _HOST_PORT_RE.match(host_port).groups() + if auth and normalize_uri: + auth = _encode_invalid_chars(auth, USERINFO_CHARS) + if port == "": +--- a/test/test_util.py ++++ b/test/test_util.py +@@ -425,6 +425,16 @@ class TestUtil(object): + query="%0D%0ASET%20test%20failure12%0D%0A:8080/test/?test=a", + ), + ), ++ # Tons of '@' causing backtracking ++ ("https://" + ("@" * 10000) + "[", False), ++ ( ++ "https://user:" + ("@" * 10000) + "example.com", ++ Url( ++ scheme="https", ++ auth="user:" + ("%40" * 9999), ++ host="example.com", ++ ), ++ ), + ] + + @pytest.mark.parametrize("url, expected_url", url_vulnerabilities) diff -Nru python-urllib3-1.25.8/debian/patches/series python-urllib3-1.25.8/debian/patches/series --- python-urllib3-1.25.8/debian/patches/series 2020-10-01 17:56:43.000000000 +0000 +++ python-urllib3-1.25.8/debian/patches/series 2023-01-18 15:49:33.000000000 +0000 @@ -2,3 +2,4 @@ 02_require-cert-verification.patch 05_avoid-embedded-ssl-match-hostname.patch CVE-2020-26137.patch +CVE-2021-33503.patch