diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-01-14 08:34:35 +0100 |
|---|---|---|
| committer | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-01-20 18:22:07 +0100 |
| commit | 12d4f40a4a5881d2e26741fbed672fd841f557f5 (patch) | |
| tree | 4850ea52e9df531e65cda982ffb562048e518adb /meta-python/recipes-devtools/python/python3-twisted/CVE-2022-24801-2.patch | |
| parent | d29ee9b3878cbaee94b4f3b7db64adca38b67a22 (diff) | |
| download | meta-openembedded-12d4f40a4a5881d2e26741fbed672fd841f557f5.tar.gz | |
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 <skandigraun@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-twisted/CVE-2022-24801-2.patch')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-twisted/CVE-2022-24801-2.patch | 63 |
1 files changed, 63 insertions, 0 deletions
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 @@ | |||
| 1 | From 232c32ca0ecc3f9d263e2184253a839ce99b4f31 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Tom Most <twm@freecog.net> | ||
| 3 | Date: Mon, 7 Mar 2022 00:02:55 -0800 | ||
| 4 | Subject: [PATCH] Replace obs-fold with a single space | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://github.com/twisted/twisted/commit/79ee8c564ca0d4c2910c8859e0a6014d2dc40005] | ||
| 7 | CVE: CVE-2022-24801 | ||
| 8 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 9 | --- | ||
| 10 | src/twisted/web/http.py | 2 +- | ||
| 11 | src/twisted/web/test/test_http.py | 13 +++++++++---- | ||
| 12 | 2 files changed, 10 insertions(+), 5 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/src/twisted/web/http.py b/src/twisted/web/http.py | ||
| 15 | index b99480f..5491953 100644 | ||
| 16 | --- a/src/twisted/web/http.py | ||
| 17 | +++ b/src/twisted/web/http.py | ||
| 18 | @@ -2246,7 +2246,7 @@ class HTTPChannel(basic.LineReceiver, policies.TimeoutMixin): | ||
| 19 | self.setRawMode() | ||
| 20 | elif line[0] in b" \t": | ||
| 21 | # Continuation of a multi line header. | ||
| 22 | - self.__header = self.__header + b"\n" + line | ||
| 23 | + self.__header += b" " + line.lstrip(b" \t") | ||
| 24 | # Regular header line. | ||
| 25 | # Processing of header line is delayed to allow accumulating multi | ||
| 26 | # line headers. | ||
| 27 | diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py | ||
| 28 | index 0549ed0..8a7adc0 100644 | ||
| 29 | --- a/src/twisted/web/test/test_http.py | ||
| 30 | +++ b/src/twisted/web/test/test_http.py | ||
| 31 | @@ -1795,7 +1795,12 @@ class ParsingTests(unittest.TestCase): | ||
| 32 | Line folded headers are handled by L{HTTPChannel} by replacing each | ||
| 33 | fold with a single space by the time they are made available to the | ||
| 34 | L{Request}. Any leading whitespace in the folded lines of the header | ||
| 35 | - value is preserved. | ||
| 36 | + value is replaced with a single space, per: | ||
| 37 | + | ||
| 38 | + A server that receives an obs-fold in a request message ... MUST | ||
| 39 | + ... replace each received obs-fold with one or more SP octets prior | ||
| 40 | + to interpreting the field value or forwarding the message | ||
| 41 | + downstream. | ||
| 42 | |||
| 43 | See RFC 7230 section 3.2.4. | ||
| 44 | """ | ||
| 45 | @@ -1832,15 +1837,15 @@ class ParsingTests(unittest.TestCase): | ||
| 46 | ) | ||
| 47 | self.assertEqual( | ||
| 48 | request.requestHeaders.getRawHeaders(b"space"), | ||
| 49 | - [b"space space"], | ||
| 50 | + [b"space space"], | ||
| 51 | ) | ||
| 52 | self.assertEqual( | ||
| 53 | request.requestHeaders.getRawHeaders(b"spaces"), | ||
| 54 | - [b"spaces spaces spaces"], | ||
| 55 | + [b"spaces spaces spaces"], | ||
| 56 | ) | ||
| 57 | self.assertEqual( | ||
| 58 | request.requestHeaders.getRawHeaders(b"tab"), | ||
| 59 | - [b"t \ta \tb"], | ||
| 60 | + [b"t a b"], | ||
| 61 | ) | ||
| 62 | |||
| 63 | def test_headerStripWhitespace(self): | ||
