From 12d4f40a4a5881d2e26741fbed672fd841f557f5 Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari Date: Wed, 14 Jan 2026 08:34:35 +0100 Subject: python3-twisted: patch CVE-2022-24801 Details: https://nvd.nist.gov/vuln/detail/CVE-2022-24801 Pick the commits from the pull request that is referenced by the NVD report. (The full set is consisting of 13 patches, but the ones that only updated news/readme/typo fixes in comments were not backported) Signed-off-by: Gyorgy Sarvari --- .../python/python3-twisted/CVE-2022-24801-2.patch | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-twisted/CVE-2022-24801-2.patch (limited to 'meta-python/recipes-devtools/python/python3-twisted/CVE-2022-24801-2.patch') diff --git a/meta-python/recipes-devtools/python/python3-twisted/CVE-2022-24801-2.patch b/meta-python/recipes-devtools/python/python3-twisted/CVE-2022-24801-2.patch new file mode 100644 index 0000000000..c9164b54f0 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-twisted/CVE-2022-24801-2.patch @@ -0,0 +1,63 @@ +From 232c32ca0ecc3f9d263e2184253a839ce99b4f31 Mon Sep 17 00:00:00 2001 +From: Tom Most +Date: Mon, 7 Mar 2022 00:02:55 -0800 +Subject: [PATCH] Replace obs-fold with a single space + +Upstream-Status: Backport [https://github.com/twisted/twisted/commit/79ee8c564ca0d4c2910c8859e0a6014d2dc40005] +CVE: CVE-2022-24801 +Signed-off-by: Gyorgy Sarvari +--- + src/twisted/web/http.py | 2 +- + src/twisted/web/test/test_http.py | 13 +++++++++---- + 2 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/src/twisted/web/http.py b/src/twisted/web/http.py +index b99480f..5491953 100644 +--- a/src/twisted/web/http.py ++++ b/src/twisted/web/http.py +@@ -2246,7 +2246,7 @@ class HTTPChannel(basic.LineReceiver, policies.TimeoutMixin): + self.setRawMode() + elif line[0] in b" \t": + # Continuation of a multi line header. +- self.__header = self.__header + b"\n" + line ++ self.__header += b" " + line.lstrip(b" \t") + # Regular header line. + # Processing of header line is delayed to allow accumulating multi + # line headers. +diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py +index 0549ed0..8a7adc0 100644 +--- a/src/twisted/web/test/test_http.py ++++ b/src/twisted/web/test/test_http.py +@@ -1795,7 +1795,12 @@ class ParsingTests(unittest.TestCase): + Line folded headers are handled by L{HTTPChannel} by replacing each + fold with a single space by the time they are made available to the + L{Request}. Any leading whitespace in the folded lines of the header +- value is preserved. ++ value is replaced with a single space, per: ++ ++ A server that receives an obs-fold in a request message ... MUST ++ ... replace each received obs-fold with one or more SP octets prior ++ to interpreting the field value or forwarding the message ++ downstream. + + See RFC 7230 section 3.2.4. + """ +@@ -1832,15 +1837,15 @@ class ParsingTests(unittest.TestCase): + ) + self.assertEqual( + request.requestHeaders.getRawHeaders(b"space"), +- [b"space space"], ++ [b"space space"], + ) + self.assertEqual( + request.requestHeaders.getRawHeaders(b"spaces"), +- [b"spaces spaces spaces"], ++ [b"spaces spaces spaces"], + ) + self.assertEqual( + request.requestHeaders.getRawHeaders(b"tab"), +- [b"t \ta \tb"], ++ [b"t a b"], + ) + + def test_headerStripWhitespace(self): -- cgit v1.2.3-54-g00ecf