summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-52304.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-52304.patch')
-rw-r--r--meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-52304.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-52304.patch b/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-52304.patch
new file mode 100644
index 0000000000..a76968c6ca
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-52304.patch
@@ -0,0 +1,46 @@
1From 27b9925ad3ac716a6db3a3d1214b3fe2a260c5c8 Mon Sep 17 00:00:00 2001
2From: "J. Nick Koston" <nick@koston.org>
3Date: Wed, 13 Nov 2024 08:50:36 -0600
4Subject: [PATCH] Fix incorrect parsing of chunk extensions with the pure
5 Python parser (#9853)
6
7Upstream-Status: Backport
8[https://github.com/aio-libs/aiohttp/commit/259edc369075de63e6f3a4eaade058c62af0df71]
9
10CVE: CVE-2024-52304
11
12Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
13---
14 CHANGES/9851.bugfix.rst | 1 +
15 aiohttp/http_parser.py | 7 +++++++
16 2 files changed, 8 insertions(+)
17 create mode 100644 CHANGES/9851.bugfix.rst
18
19diff --git a/CHANGES/9851.bugfix.rst b/CHANGES/9851.bugfix.rst
20new file mode 100644
21index 0000000..02541a9
22--- /dev/null
23+++ b/CHANGES/9851.bugfix.rst
24@@ -0,0 +1 @@
25+Fixed incorrect parsing of chunk extensions with the pure Python parser -- by :user:`bdraco`.
26diff --git a/aiohttp/http_parser.py b/aiohttp/http_parser.py
27index 91e01f4..1ee1269 100644
28--- a/aiohttp/http_parser.py
29+++ b/aiohttp/http_parser.py
30@@ -820,6 +820,13 @@ class HttpPayloadParser:
31 i = chunk.find(CHUNK_EXT, 0, pos)
32 if i >= 0:
33 size_b = chunk[:i] # strip chunk-extensions
34+ # Verify no LF in the chunk-extension
35+ if b"\n" in (ext := chunk[i:pos]):
36+ exc = BadHttpMessage(
37+ f"Unexpected LF in chunk-extension: {ext!r}"
38+ )
39+ set_exception(self.payload, exc)
40+ raise exc
41 else:
42 size_b = chunk[:pos]
43
44--
452.25.1
46