CVE-2024-42367 In aiohttp, compressed files as symlinks are not protected from path traversal
Attackers can read arbitrary files outside the root directory via symlinked compressed files in aiohttp static routes.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-42367?
CVE-2024-42367 is a medium-severity path traversal vulnerability in aio-libs aiohttp, published on 9 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. In versions on the 3.10 branch prior to version 3.10.2, static routes which contain files with compressed variants (`.gz` or `.br` extension) are vulnerable to path traversal outside the root directory if those variants are symbolic links. The server protects static routes from path traversal outside the root directory when `follow_symlinks=False` (default). It does this by resolving the requested URL to an absolute path and then checking that path relative to the root. However, these checks are not performed when looking for compressed variants in the `FileResponse` class, and symbolic links are then automatically followed when performing the `Path.stat()` and `Path.open()` to send the file. Version 3.10.2 contains a patch for the issue.
Weakness: CWE-61
Which versions are affected by CVE-2024-42367?
3 open source packages ship an affected version, including aiohttp. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
aiohttp PyPI | From 3.10.0b1 | 3.10.2 |
aiohttp PyPI | From 3.10.0b1 | 3.10.2 |
aiohttp PyPI | From 3.10.0b1 | 3.10.2 |
Linux distribution packages (6)
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP4 | All versions | 3.9.3-150400.10.24.1 |
python-aiohttp SUSE:Linux Enterprise Module for Python 3 15 SP5 | All versions | 3.9.3-150400.10.24.1 |
python-aiohttp SUSE:Linux Enterprise Module for Python 3 15 SP6 | All versions | 3.9.3-150400.10.24.1 |
python-aiohttp openSUSE:Leap 15.5 | All versions | 3.9.3-150400.10.24.1 |
python-aiohttp openSUSE:Leap 15.6 | All versions | 3.9.3-150400.10.24.1 |
python-aiohttp openSUSE:Tumbleweed | All versions | 3.10.5-1.1 |
Products include Aiohttp Aiohttp.
How do I fix CVE-2024-42367?
Upgrade aiohttp to 3.10.2 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2024-42367 being exploited?
There is no known exploitation of CVE-2024-42367 in the wild and no public exploit code.
Other vulnerabilities in aio-libs aiohttp
- CVE-2024-52303 aiohttp memory leak when middleware is enabled when requesting a resource with a non-allowed method
- CVE-2025-69223 AIOHTTP's HTTP Parser auto_decompress feature is vulnerable to zip bomb
- CVE-2024-30251 Denial of service when trying to parse malformed POST requests in aiohttp
- CVE-2023-49081 aiohttp's ClientSession is vulnerable to CRLF injection via version
- CVE-2026-22815 AIOHTTP: Uncapped memory usage possible through aiohttp allowing unlimited trailer headers
Sources
Also known as AZL-47754, AZL-47763, DEBIAN-CVE-2024-42367, GHSA-jwhx-xcg6-8xhj, OESA-2024-2254, PYSEC-2026-1108 and 2 more.