python3-waitress: upgrade 2.1.1 -> 2.1.2
PATCH 1/5 python3-waitress: upgrade 2.1.1 -> 2.1.2
From: wangmy <[email protected]>
Remove change of default for clear_untrusted_proxy_headers
Contains fix for CVE-2022-31015
---
.../{python3-waitress_2.1.1.bb => python3-waitress_2.1.2.bb} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
rename meta-python/recipes-devtools/python/{python3-waitress_2.1.1.bb => python3-waitress_2.1.2.bb} (82%)meta-python/recipes-devtools/python/python3-waitress_2.1.2.bb renamed from meta-python/recipes-devtools/python/python3-waitress_2.1.1.bb +1 -1
@@ -10,6 +10,6 @@ RDEPENDS:${PN} += " \ python3-logging \ " -SRC_URI[sha256sum] = "e2e60576cf14a1539da79f7b7ee1e79a71e64f366a0b47db54a15e971f57bb16" +SRC_URI[sha256sum] = "780a4082c5fbc0fde6a2fcfe5e26e6efc1e8f425730863c04085769781f51eba" inherit python_setuptools_build_meta pypi
PATCH 2/5 python3-werkzeug: ignore CVE-2024-49766 and CVE-2025-66221
Details: https://nvd.nist.gov/vuln/detail/CVE-2024-49766
https://nvd.nist.gov/vuln/detail/CVE-2025-66221
Both vulnerabilities affect Windows only - ignore them.
--- meta-python/recipes-devtools/python/python3-werkzeug_2.1.1.bb | 3 +++ 1 file changed, 3 insertions(+)
meta-python/recipes-devtools/python/python3-werkzeug_2.1.1.bb +3 -0
@@ -43,3 +43,6 @@ RDEPENDS:${PN} += " \ ${PYTHON_PN}-misc \ ${PYTHON_PN}-profile \ " + +# Windows-only vulnerabilities +CVE_CHECK_IGNORE = "CVE-2024-49766 CVE-2025-66221"
PATCH 3/5 python3-waitress: patch CVE-2024-49768
In reply to Gyorgy SarvariDetails: https://nvd.nist.gov/vuln/detail/CVE-2024-49768
Pick the patch mentioned in the NVD report (which is a merge commit, and the patches here are the individual commits from that merge)
--- .../python3-waitress/CVE-2024-49768-1.patch | 162 ++++++++++++++++++ .../python3-waitress/CVE-2024-49768-2.patch | 89 ++++++++++ .../python3-waitress/CVE-2024-49768-3.patch | 60 +++++++ .../python3-waitress/CVE-2024-49768-4.patch | 34 ++++ .../python/python3-waitress_2.1.2.bb | 5 + 5 files changed, 350 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49768-1.patch create mode 100644 meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49768-2.patch create mode 100644 meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49768-3.patch create mode 100644 meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49768-4.patch
meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49768-1.patch new file +162 -0
@@ -0,0 +1,162 @@ +From f2ffe56f990a74450143901ac1cfd7138f75ec78 Mon Sep 17 00:00:00 2001 +From: Delta Regeer <[email protected]> +Date: Sat, 26 Oct 2024 22:10:36 -0600 +Subject: [PATCH] Make DummySock() look more like an actual socket + +This forces DummySock() to look like a properly connected socket where +there is a buffer that is read from by the remote, and a buffer that is +written to by the remote. + +The local side does the opposite, this way data written by the local +side can be read by the remote without operating on the same buffer. + +CVE: CVE-2024-49768 +Upstream-Status: Backport [https://github.com/Pylons/waitress/commit/6943dcf556610ece2ff3cddb39e59a05ef110661] +Signed-off-by: Gyorgy Sarvari <[email protected]> +--- + tests/test_channel.py | 57 +++++++++++++++++++++++++++++++++---------- + 1 file changed, 44 insertions(+), 13 deletions(-) + +diff --git a/tests/test_channel.py b/tests/test_channel.py +index 8467ae7..7d677e9 100644 +--- a/tests/test_channel.py ++++ b/tests/test_channel.py +@@ -18,7 +18,7 @@ class TestHTTPChannel(unittest.TestCase): + map = {} + inst = self._makeOne(sock, "127.0.0.1", adj, map=map) + inst.outbuf_lock = DummyLock() +- return inst, sock, map ++ return inst, sock.local(), map + + def test_ctor(self): + inst, _, map = self._makeOneWithMap() +@@ -218,7 +218,7 @@ class TestHTTPChannel(unittest.TestCase): + def send(_): + return 0 + +- sock.send = send ++ sock.remote.send = send + + wrote = inst.write_soon(b"a") + self.assertEqual(wrote, 1) +@@ -236,7 +236,7 @@ class TestHTTPChannel(unittest.TestCase): + def send(_): + return 0 + +- sock.send = send ++ sock.remote.send = send + + outbufs = inst.outbufs + wrote = inst.write_soon(wrapper) +@@ -270,7 +270,7 @@ class TestHTTPChannel(unittest.TestCase): + def send(_): + return 0 + +- sock.send = send ++ sock.remote.send = send + + inst.adj.outbuf_high_watermark = 3 + inst.current_outbuf_count = 4 +@@ -286,7 +286,7 @@ class TestHTTPChannel(unittest.TestCase): + def send(_): + return 0 + +- sock.send = send ++ sock.remote.send = send + + inst.adj.outbuf_high_watermark = 3 + inst.total_outbufs_len = 4 +@@ -315,7 +315,7 @@ class TestHTTPChannel(unittest.TestCase): + inst.connected = False + raise Exception() + +- sock.send = send ++ sock.remote.send = send + + inst.adj.outbuf_high_watermark = 3 + inst.total_outbufs_len = 4 +@@ -345,7 +345,7 @@ class TestHTTPChannel(unittest.TestCase): + inst.connected = False + raise Exception() + +- sock.send = send ++ sock.remote.send = send + + wrote = inst.write_soon(b"xyz") + self.assertEqual(wrote, 3) +@@ -376,7 +376,7 @@ class TestHTTPChannel(unittest.TestCase): + inst.total_outbufs_len = len(inst.outbufs[0]) + inst.adj.send_bytes = 1 + inst.adj.outbuf_high_watermark = 2 +- sock.send = lambda x, do_close=True: False ++ sock.remote.send = lambda x, do_close=True: False + inst.will_close = False + inst.last_activity = 0 + result = inst.handle_write() +@@ -400,7 +400,7 @@ class TestHTTPChannel(unittest.TestCase): + + def test__flush_some_full_outbuf_socket_returns_zero(self): + inst, sock, map = self._makeOneWithMap() +- sock.send = lambda x: False ++ sock.remote.send = lambda x: False + inst.outbufs[0].append(b"abc") + inst.total_outbufs_len = sum(len(x) for x in inst.outbufs) + result = inst._flush_some() +@@ -907,7 +907,8 @@ class DummySock: + closed = False + + def __init__(self): +- self.sent = b"" ++ self.local_sent = b"" ++ self.remote_sent = b"" + + def setblocking(self, *arg): + self.blocking = True +@@ -925,14 +926,44 @@ class DummySock: + self.closed = True + + def send(self, data): +- self.sent += data ++ self.remote_sent += data + return len(data) + + def recv(self, buffer_size): +- result = self.sent[:buffer_size] +- self.sent = self.sent[buffer_size:] ++ result = self.local_sent[:buffer_size] ++ self.local_sent = self.local_sent[buffer_size:] + return result + ++ def local(self): ++ outer = self ++ ++ class LocalDummySock: ++ def send(self, data): ++ outer.local_sent += data ++ return len(data) ++ ++ def recv(self, buffer_size): ++ result = outer.remote_sent[:buffer_size] ++ outer.remote_sent = outer.remote_sent[buffer_size:] ++ return result ++ ++ def close(self): ++ outer.closed = True ++ ++ @property ++ def sent(self): ++ return outer.remote_sent ++ ++ @property ++ def closed(self): ++ return outer.closed ++ ++ @property ++ def remote(self): ++ return outer ++ ++ return LocalDummySock() ++ + + class DummyLock: + notified = False
meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49768-2.patch new file +89 -0
89 lines not on this page · raw message
meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49768-3.patch new file +60 -0
60 lines not on this page · raw message
meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49768-4.patch new file +34 -0
@@ -0,0 +1,34 @@ +From c516dad4f749d1b1b1c675680a76c1f6d2523857 Mon Sep 17 00:00:00 2001 +From: Delta Regeer <[email protected]> +Date: Sat, 26 Oct 2024 22:22:32 -0600 +Subject: [PATCH] Add documentation for channel_request_lookahead + +CVE: CVE-2024-49768 +Upstream-Status: Backport [https://github.com/Pylons/waitress/commit/810a435f9e9e293bd3446a5ce2df86f59c4e7b1b] +Signed-off-by: Gyorgy Sarvari <[email protected]> +--- + docs/arguments.rst | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/docs/arguments.rst b/docs/arguments.rst +index f9b9310..ba1797a 100644 +--- a/docs/arguments.rst ++++ b/docs/arguments.rst +@@ -301,3 +301,17 @@ url_prefix + be stripped of the prefix. + + Default: ``''`` ++ ++channel_request_lookahead ++ Sets the amount of requests we can continue to read from the socket, while ++ we are processing current requests. The default value won't allow any ++ lookahead, increase it above ``0`` to enable. ++ ++ When enabled this inserts a callable ``waitress.client_disconnected`` into ++ the environment that allows the task to check if the client disconnected ++ while waiting for the response at strategic points in the execution and to ++ cancel the operation. ++ ++ Default: ``0`` ++ ++ .. versionadded:: 2.0.0
meta-python/recipes-devtools/python/python3-waitress_2.1.2.bb +5 -0
@@ -10,6 +10,11 @@ RDEPENDS:${PN} += " \ python3-logging \ " +SRC_URI += "file://CVE-2024-49768-1.patch \ + file://CVE-2024-49768-2.patch \ + file://CVE-2024-49768-3.patch \ + file://CVE-2024-49768-4.patch \ + " SRC_URI[sha256sum] = "780a4082c5fbc0fde6a2fcfe5e26e6efc1e8f425730863c04085769781f51eba" inherit python_setuptools_build_meta pypi
PATCH 4/5 python3-waitress: patch CVE-2024-49769
In reply to Gyorgy SarvariDetails: https://nvd.nist.gov/vuln/detail/CVE-2024-49769
Pick the patch that is referenced in the NVD report (which is a merge commit. The patches here are the individual patches from that merge).
--- .../python3-waitress/CVE-2024-49769-1.patch | 27 +++ .../python3-waitress/CVE-2024-49769-2.patch | 53 +++++ .../python3-waitress/CVE-2024-49769-3.patch | 34 +++ .../python3-waitress/CVE-2024-49769-4.patch | 34 +++ .../python3-waitress/CVE-2024-49769-5.patch | 211 ++++++++++++++++++ .../python3-waitress/CVE-2024-49769-6.patch | 41 ++++ .../python/python3-waitress_2.1.2.bb | 6 + 7 files changed, 406 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-1.patch create mode 100644 meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-2.patch create mode 100644 meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-3.patch create mode 100644 meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-4.patch create mode 100644 meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-5.patch create mode 100644 meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-6.patch
meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-1.patch new file +27 -0
@@ -0,0 +1,27 @@ +From fdabcb31093507f50fcaeb46012ec8df8bf76359 Mon Sep 17 00:00:00 2001 +From: Delta Regeer <[email protected]> +Date: Sun, 3 Mar 2024 16:15:51 -0700 +Subject: [PATCH] HTTPChannel is always created from accept, explicitly set + self.connected to True + +CVE: CVE-2024-49769 +Upstream-Status: Backport [https://github.com/Pylons/waitress/commit/03cc640fe7106902899f82115c26e37002bca7f1] +Signed-off-by: Gyorgy Sarvari <[email protected]> +--- + src/waitress/channel.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/waitress/channel.py b/src/waitress/channel.py +index 756adce..cf19ef2 100644 +--- a/src/waitress/channel.py ++++ b/src/waitress/channel.py +@@ -67,8 +67,7 @@ class HTTPChannel(wasyncore.dispatcher): + self.outbuf_lock = threading.Condition() + + wasyncore.dispatcher.__init__(self, sock, map=map) +- +- # Don't let wasyncore.dispatcher throttle self.addr on us. ++ self.connected = True + self.addr = addr + self.requests = [] +
meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-2.patch new file +53 -0
53 lines not on this page · raw message
meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-3.patch new file +34 -0
@@ -0,0 +1,34 @@ +From 28377c0e0fdd8669fb250e69745caf1c27ba541b Mon Sep 17 00:00:00 2001 +From: Delta Regeer <[email protected]> +Date: Sun, 3 Mar 2024 16:23:33 -0700 +Subject: [PATCH] Remove test for getpeername() + +CVE: CVE-2024-49769 +Upstream-Status: Backport [https://github.com/Pylons/waitress/commit/86c680df4e4bdd40c78dec771cddcee059e802c4] +Signed-off-by: Gyorgy Sarvari <[email protected]> +--- + tests/test_wasyncore.py | 11 ----------- + 1 file changed, 11 deletions(-) + +diff --git a/tests/test_wasyncore.py b/tests/test_wasyncore.py +index e833c7e..5f38bd9 100644 +--- a/tests/test_wasyncore.py ++++ b/tests/test_wasyncore.py +@@ -1451,17 +1451,6 @@ class Test_dispatcher(unittest.TestCase): + + return dispatcher(sock=sock, map=map) + +- def test_unexpected_getpeername_exc(self): +- sock = dummysocket() +- +- def getpeername(): +- raise OSError(errno.EBADF) +- +- map = {} +- sock.getpeername = getpeername +- self.assertRaises(socket.error, self._makeOne, sock=sock, map=map) +- self.assertEqual(map, {}) +- + def test___repr__accepting(self): + sock = dummysocket() + map = {}
meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-4.patch new file +34 -0
@@ -0,0 +1,34 @@ +From ee501847c38e21be0683ba81925472f219044a65 Mon Sep 17 00:00:00 2001 +From: Delta Regeer <[email protected]> +Date: Sun, 3 Mar 2024 16:26:22 -0700 +Subject: [PATCH] Don't exit handle_write early -- even if socket is not + connected + +Calling handle_close() multiple times does not hurt anything, and is +safe. + +CVE: CVE-2024-49769 +Upstream-Status: Backport [https://github.com/Pylons/waitress/commit/8cba302b1ac08c2874ae179b2af2445e89311bac] +Signed-off-by: Gyorgy Sarvari <[email protected]> +--- + src/waitress/channel.py | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/src/waitress/channel.py b/src/waitress/channel.py +index cf19ef2..f4d9677 100644 +--- a/src/waitress/channel.py ++++ b/src/waitress/channel.py +@@ -91,13 +91,7 @@ class HTTPChannel(wasyncore.dispatcher): + # Precondition: there's data in the out buffer to be sent, or + # there's a pending will_close request + +- if not self.connected: +- # we dont want to close the channel twice +- +- return +- + # try to flush any pending output +- + if not self.requests: + # 1. There are no running tasks, so we don't need to try to lock + # the outbuf before sending
meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-5.patch new file +211 -0
211 lines not on this page · raw message
meta-python/recipes-devtools/python/python3-waitress/CVE-2024-49769-6.patch new file +41 -0
41 lines not on this page · raw message
meta-python/recipes-devtools/python/python3-waitress_2.1.2.bb +6 -0
@@ -14,6 +14,12 @@ SRC_URI += "file://CVE-2024-49768-1.patch \ file://CVE-2024-49768-2.patch \ file://CVE-2024-49768-3.patch \ file://CVE-2024-49768-4.patch \ + file://CVE-2024-49769-1.patch \ + file://CVE-2024-49769-2.patch \ + file://CVE-2024-49769-3.patch \ + file://CVE-2024-49769-4.patch \ + file://CVE-2024-49769-5.patch \ + file://CVE-2024-49769-6.patch \ " SRC_URI[sha256sum] = "780a4082c5fbc0fde6a2fcfe5e26e6efc1e8f425730863c04085769781f51eba"
PATCH 5/5 python3-m2crypto: ignore CVE-2009-0127
In reply to Gyorgy SarvariDetails: https://nvd.nist.gov/vuln/detail/CVE-2009-0127
The vulnerability is disputed[1] by upstream:
"There is no vulnerability in M2Crypto. Nowhere in the functions are the return values of OpenSSL functions interpreted incorrectly. The functions provide an interface to their users that may be considered confusing, but is not incorrect, nor it is a vulnerability."
[1]: https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2009-0127
--- meta-python/recipes-devtools/python/python3-m2crypto_0.38.0.bb | 3 +++ 1 file changed, 3 insertions(+)
meta-python/recipes-devtools/python/python3-m2crypto_0.38.0.bb +3 -0
@@ -45,4 +45,7 @@ export SWIG_FEATURES export STAGING_DIR +# disputed, upstream claims there is no bug +CVE_CHECK_IGNORE = "CVE-2009-0127" + BBCLASSEXTEND = "native"