summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2026-01-20 14:52:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2026-01-26 09:49:25 +0000
commit4c8419bebefe1b686166ab08d891cdc4d29257d5 (patch)
tree0bd01ac1e075145da25b62b393ea3d47e282971c /meta/recipes-devtools
parent842275784a3a960d701319fd33415cfd8f1ad43c (diff)
downloadpoky-4c8419bebefe1b686166ab08d891cdc4d29257d5.tar.gz
python3-urllib3: patch CVE-2025-66418
Pick patch per [1]. [1] https://nvd.nist.gov/vuln/detail/CVE-2025-66418 (From OE-Core rev: 469fcdd5f07635fa9e308c968126807c1ca09647) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Paul Barker <paul@pbarker.dev> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/python/python3-urllib3/CVE-2025-66418.patch74
-rw-r--r--meta/recipes-devtools/python/python3-urllib3_1.26.20.bb1
2 files changed, 75 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-urllib3/CVE-2025-66418.patch b/meta/recipes-devtools/python/python3-urllib3/CVE-2025-66418.patch
new file mode 100644
index 0000000000..b490019d87
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-urllib3/CVE-2025-66418.patch
@@ -0,0 +1,74 @@
1From 24d7b67eac89f94e11003424bcf0d8f7b72222a8 Mon Sep 17 00:00:00 2001
2From: Illia Volochii <illia.volochii@gmail.com>
3Date: Fri, 5 Dec 2025 16:41:33 +0200
4Subject: [PATCH] Merge commit from fork
5
6* Add a hard-coded limit for the decompression chain
7
8* Reuse new list
9
10CVE: CVE-2025-66418
11Upstream-Status: Backport [https://github.com/urllib3/urllib3/commit/24d7b67eac89f94e11003424bcf0d8f7b72222a8]
12Signed-off-by: Peter Marko <peter.marko@siemens.com>
13---
14 changelog/GHSA-gm62-xv2j-4w53.security.rst | 4 ++++
15 src/urllib3/response.py | 12 +++++++++++-
16 test/test_response.py | 10 ++++++++++
17 3 files changed, 25 insertions(+), 1 deletion(-)
18 create mode 100644 changelog/GHSA-gm62-xv2j-4w53.security.rst
19
20diff --git a/changelog/GHSA-gm62-xv2j-4w53.security.rst b/changelog/GHSA-gm62-xv2j-4w53.security.rst
21new file mode 100644
22index 00000000..6646eaa3
23--- /dev/null
24+++ b/changelog/GHSA-gm62-xv2j-4w53.security.rst
25@@ -0,0 +1,4 @@
26+Fixed a security issue where an attacker could compose an HTTP response with
27+virtually unlimited links in the ``Content-Encoding`` header, potentially
28+leading to a denial of service (DoS) attack by exhausting system resources
29+during decoding. The number of allowed chained encodings is now limited to 5.
30diff --git a/src/urllib3/response.py b/src/urllib3/response.py
31index 4ba42136..069f726c 100644
32--- a/src/urllib3/response.py
33+++ b/src/urllib3/response.py
34@@ -135,8 +135,18 @@ class MultiDecoder(object):
35 they were applied.
36 """
37
38+ # Maximum allowed number of chained HTTP encodings in the
39+ # Content-Encoding header.
40+ max_decode_links = 5
41+
42 def __init__(self, modes):
43- self._decoders = [_get_decoder(m.strip()) for m in modes.split(",")]
44+ encodings = [m.strip() for m in modes.split(",")]
45+ if len(encodings) > self.max_decode_links:
46+ raise DecodeError(
47+ "Too many content encodings in the chain: "
48+ f"{len(encodings)} > {self.max_decode_links}"
49+ )
50+ self._decoders = [_get_decoder(e) for e in encodings]
51
52 def flush(self):
53 return self._decoders[0].flush()
54diff --git a/test/test_response.py b/test/test_response.py
55index 9592fdd9..d824ae70 100644
56--- a/test/test_response.py
57+++ b/test/test_response.py
58@@ -295,6 +295,16 @@ class TestResponse(object):
59
60 assert r.data == b"foo"
61
62+ def test_read_multi_decoding_too_many_links(self) -> None:
63+ fp = BytesIO(b"foo")
64+ with pytest.raises(
65+ DecodeError, match="Too many content encodings in the chain: 6 > 5"
66+ ):
67+ HTTPResponse(
68+ fp,
69+ headers={"content-encoding": "gzip, deflate, br, zstd, gzip, deflate"},
70+ )
71+
72 def test_body_blob(self):
73 resp = HTTPResponse(b"foo")
74 assert resp.data == b"foo"
diff --git a/meta/recipes-devtools/python/python3-urllib3_1.26.20.bb b/meta/recipes-devtools/python/python3-urllib3_1.26.20.bb
index 58988e4205..1f1132d5b5 100644
--- a/meta/recipes-devtools/python/python3-urllib3_1.26.20.bb
+++ b/meta/recipes-devtools/python/python3-urllib3_1.26.20.bb
@@ -9,6 +9,7 @@ inherit pypi setuptools3
9 9
10SRC_URI += " \ 10SRC_URI += " \
11 file://CVE-2025-50181.patch \ 11 file://CVE-2025-50181.patch \
12 file://CVE-2025-66418.patch \
12" 13"
13 14
14RDEPENDS:${PN} += "\ 15RDEPENDS:${PN} += "\