python-urllib3/SOURCES/CVE-2023-43804.patch

40 lines
1.3 KiB
Diff

From 24603488c43a7cbaffcff7e69a72ad9bb4604acf Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
Date: Thu, 12 Oct 2023 14:08:31 +0200
Subject: [PATCH] CVE-2023-43804
---
src/urllib3/util/retry.py | 2 +-
test/test_retry.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/urllib3/util/retry.py b/src/urllib3/util/retry.py
index 02429ee..c4a687c 100644
--- a/src/urllib3/util/retry.py
+++ b/src/urllib3/util/retry.py
@@ -151,7 +151,7 @@ class Retry(object):
RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503])
- DEFAULT_REDIRECT_HEADERS_BLACKLIST = frozenset(['Authorization'])
+ DEFAULT_REDIRECT_HEADERS_BLACKLIST = frozenset(['Cookie', 'Authorization'])
#: Maximum backoff time.
BACKOFF_MAX = 120
diff --git a/test/test_retry.py b/test/test_retry.py
index 7546c43..b6d52bf 100644
--- a/test/test_retry.py
+++ b/test/test_retry.py
@@ -253,7 +253,7 @@ class TestRetry(object):
def test_retry_default_remove_headers_on_redirect(self):
retry = Retry()
- assert list(retry.remove_headers_on_redirect) == ['authorization']
+ assert retry.remove_headers_on_redirect == {'authorization', 'cookie'}
def test_retry_set_remove_headers_on_redirect(self):
retry = Retry(remove_headers_on_redirect=['x-api-secret'])
--
2.41.0