summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-42367.patch
diff options
context:
space:
mode:
authorJiaying Song <jiaying.song.cn@windriver.com>2025-07-16 15:37:58 +0800
committerGyorgy Sarvari <skandigraun@gmail.com>2025-09-06 16:27:05 +0200
commit78afe9d40cb41f9b7691b4ec4183ca442e70fb63 (patch)
tree6618e6bd598b9ac16572b890908801e6e64a1fa1 /meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-42367.patch
parent89b98ccbfb7c52577ebab7c4306c9fdb8aee81a6 (diff)
downloadmeta-openembedded-78afe9d40cb41f9b7691b4ec4183ca442e70fb63.tar.gz
python3-aiohttp: fix CVE-2025-53643 and drop CVE-2024-42367 patch
- Fix CVE-2025-53643: AIOHTTP is an asynchronous HTTP client/server framework for asyncio and Python. Prior to version 3.12.14, the Python parser is vulnerable to a request smuggling vulnerability due to not parsing trailer sections of an HTTP request. If a pure Python version of aiohttp is installed (i.e. without the usual C extensions) or AIOHTTP_NO_EXTENSIONS is enabled, then an attacker may be able to execute a request smuggling attack to bypass certain firewalls or proxy protections. Version 3.12.14 contains a patch for this issue. References: https://nvd.nist.gov/vuln/detail/CVE-2025-53643 - Drop CVE-2024-42367.patch: According to upstream discussion and advisory [1][2], aiohttp 3.8.6 is not affected by CVE-2024-42367, and the patch is therefore no longer needed. [1] https://github.com/advisories/GHSA-jwhx-xcg6-8xhj [2] https://github.com/aio-libs/aiohttp/issues/11149 Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com> Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-42367.patch')
-rw-r--r--meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-42367.patch65
1 files changed, 0 insertions, 65 deletions
diff --git a/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-42367.patch b/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-42367.patch
deleted file mode 100644
index dadec31f3a..0000000000
--- a/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2024-42367.patch
+++ /dev/null
@@ -1,65 +0,0 @@
1From e19cb50fb529bbe75cc4f1b68eeb0a3f631ad0d0 Mon Sep 17 00:00:00 2001
2From: "J. Nick Koston" <nick@koston.org>
3Date: Thu, 8 Aug 2024 11:19:28 -0500
4Subject: [PATCH] Do not follow symlinks for compressed file variants (#8652)
5
6CVE: CVE-2024-42367
7
8Upstream-Status: Backport
9[https://github.com/aio-libs/aiohttp/commit/ce2e9758814527589b10759a20783fb03b98339f]
10
11Co-authored-by: Steve Repsher <steverep@users.noreply.github.com>
12Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
13---
14 CHANGES/8652.bugfix.rst | 1 +
15 aiohttp/web_fileresponse.py | 26 ++++++++++++++++++++++++++
16 2 files changed, 27 insertions(+)
17 create mode 100644 CHANGES/8652.bugfix.rst
18
19diff --git a/CHANGES/8652.bugfix.rst b/CHANGES/8652.bugfix.rst
20new file mode 100644
21index 000000000..3a1003e50
22--- /dev/null
23+++ b/CHANGES/8652.bugfix.rst
24@@ -0,0 +1 @@
25+Fixed incorrectly following symlinks for compressed file variants -- by :user:`steverep`.
26diff --git a/aiohttp/web_fileresponse.py b/aiohttp/web_fileresponse.py
27index f41ed3fd0..35dbd41e1 100644
28--- a/aiohttp/web_fileresponse.py
29+++ b/aiohttp/web_fileresponse.py
30@@ -127,6 +127,32 @@ class FileResponse(StreamResponse):
31 self.content_length = 0
32 return await super().prepare(request)
33
34+ def _get_file_path_stat_encoding(
35+ self, accept_encoding: str
36+ ) -> Tuple[pathlib.Path, os.stat_result, Optional[str]]:
37+ """Return the file path, stat result, and encoding.
38+
39+ If an uncompressed file is returned, the encoding is set to
40+ :py:data:`None`.
41+
42+ This method should be called from a thread executor
43+ since it calls os.stat which may block.
44+ """
45+ file_path = self._path
46+ for file_extension, file_encoding in ENCODING_EXTENSIONS.items():
47+ if file_encoding not in accept_encoding:
48+ continue
49+
50+ compressed_path = file_path.with_suffix(file_path.suffix + file_extension)
51+ with suppress(OSError):
52+ # Do not follow symlinks and ignore any non-regular files.
53+ st = compressed_path.lstat()
54+ if S_ISREG(st.st_mode):
55+ return compressed_path, st, file_encoding
56+
57+ # Fallback to the uncompressed file
58+ return file_path, file_path.stat(), None
59+
60 async def prepare(self, request: "BaseRequest") -> Optional[AbstractStreamWriter]:
61 filepath = self._path
62
63--
642.34.1
65