Le mar. 20 janv. 2026 à 14:52, Peter Marko via lists.openembedded.org
<[email protected]> a écrit :

> From: Peter Marko <[email protected]>
>
> Pick patch per [1].
>
> [1] https://nvd.nist.gov/vuln/detail/CVE-2025-66418
>
> Signed-off-by: Peter Marko <[email protected]>
>

Thanks for the quick update!

I've taken this in my stable/kirkstone-nut branch and rebuilt a-full which
succeeded :
https://autobuilder.yoctoproject.org/valkyrie/?#/builders/29/builds/3097
I will include this v2 in my pull request.


> ---
>  .../python3-urllib3/CVE-2025-66418.patch      | 74 +++++++++++++++++++
>  .../python/python3-urllib3_1.26.20.bb         |  1 +
>  2 files changed, 75 insertions(+)
>  create mode 100644
> meta/recipes-devtools/python/python3-urllib3/CVE-2025-66418.patch
>
> 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 00000000000..b490019d877
> --- /dev/null
> +++ b/meta/recipes-devtools/python/python3-urllib3/CVE-2025-66418.patch
> @@ -0,0 +1,74 @@
> +From 24d7b67eac89f94e11003424bcf0d8f7b72222a8 Mon Sep 17 00:00:00 2001
> +From: Illia Volochii <[email protected]>
> +Date: Fri, 5 Dec 2025 16:41:33 +0200
> +Subject: [PATCH] Merge commit from fork
> +
> +* Add a hard-coded limit for the decompression chain
> +
> +* Reuse new list
> +
> +CVE: CVE-2025-66418
> +Upstream-Status: Backport [
> https://github.com/urllib3/urllib3/commit/24d7b67eac89f94e11003424bcf0d8f7b72222a8
> ]
> +Signed-off-by: Peter Marko <[email protected]>
> +---
> + changelog/GHSA-gm62-xv2j-4w53.security.rst |  4 ++++
> + src/urllib3/response.py                    | 12 +++++++++++-
> + test/test_response.py                      | 10 ++++++++++
> + 3 files changed, 25 insertions(+), 1 deletion(-)
> + create mode 100644 changelog/GHSA-gm62-xv2j-4w53.security.rst
> +
> +diff --git a/changelog/GHSA-gm62-xv2j-4w53.security.rst
> b/changelog/GHSA-gm62-xv2j-4w53.security.rst
> +new file mode 100644
> +index 00000000..6646eaa3
> +--- /dev/null
> ++++ b/changelog/GHSA-gm62-xv2j-4w53.security.rst
> +@@ -0,0 +1,4 @@
> ++Fixed a security issue where an attacker could compose an HTTP response
> with
> ++virtually unlimited links in the ``Content-Encoding`` header, potentially
> ++leading to a denial of service (DoS) attack by exhausting system
> resources
> ++during decoding. The number of allowed chained encodings is now limited
> to 5.
> +diff --git a/src/urllib3/response.py b/src/urllib3/response.py
> +index 4ba42136..069f726c 100644
> +--- a/src/urllib3/response.py
> ++++ b/src/urllib3/response.py
> +@@ -135,8 +135,18 @@ class MultiDecoder(object):
> +         they were applied.
> +     """
> +
> ++    # Maximum allowed number of chained HTTP encodings in the
> ++    # Content-Encoding header.
> ++    max_decode_links = 5
> ++
> +     def __init__(self, modes):
> +-        self._decoders = [_get_decoder(m.strip()) for m in
> modes.split(",")]
> ++        encodings = [m.strip() for m in modes.split(",")]
> ++        if len(encodings) > self.max_decode_links:
> ++            raise DecodeError(
> ++                "Too many content encodings in the chain: "
> ++                f"{len(encodings)} > {self.max_decode_links}"
> ++            )
> ++        self._decoders = [_get_decoder(e) for e in encodings]
> +
> +     def flush(self):
> +         return self._decoders[0].flush()
> +diff --git a/test/test_response.py b/test/test_response.py
> +index 9592fdd9..d824ae70 100644
> +--- a/test/test_response.py
> ++++ b/test/test_response.py
> +@@ -295,6 +295,16 @@ class TestResponse(object):
> +
> +         assert r.data == b"foo"
> +
> ++    def test_read_multi_decoding_too_many_links(self) -> None:
> ++        fp = BytesIO(b"foo")
> ++        with pytest.raises(
> ++            DecodeError, match="Too many content encodings in the chain:
> 6 > 5"
> ++        ):
> ++            HTTPResponse(
> ++                fp,
> ++                headers={"content-encoding": "gzip, deflate, br, zstd,
> gzip, deflate"},
> ++            )
> ++
> +     def test_body_blob(self):
> +         resp = HTTPResponse(b"foo")
> +         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 58988e42055..1f1132d5b5d 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
>
>  SRC_URI += " \
>      file://CVE-2025-50181.patch \
> +    file://CVE-2025-66418.patch \
>  "
>
>  RDEPENDS:${PN} += "\
>
> 
>
>

-- 
Yoann Congal
Smile ECS
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#229785): 
https://lists.openembedded.org/g/openembedded-core/message/229785
Mute This Topic: https://lists.openembedded.org/mt/117362843/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to