Vulnerability · Published Jan 29, 2024 · Assigned by GitHub_M
CVE-2024-23334aiohttp.web.static(follow_symlinks=True) is vulnerable to directory traversal
Medium 5.9
In plain English
A medium-severity path traversal in aiohttp from aio-libs. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 76.9% (higher than 99.6% of all known vulnerabilities). Ready-made attack tooling exists: Nuclei, public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official description
aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. When using aiohttp as a web server and configuring static routes, it is necessary to specify the root path for static files. Additionally, the option 'follow_symlinks' can be used to determine whether to follow symbolic links outside the static root directory. When 'follow_symlinks' is set to True, there is no validation to check if reading a file is within the root directory. This can lead to directory traversal vulnerabilities, resulting in unauthorized access to arbitrary files on the system, even when symlinks are not present. Disabling follow_symlinks and using a reverse proxy are encouraged mitigations. Version 3.9.2 fixes this issue.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | py3-aiohttp | 3.9.3-r0 | ALPINE-CVE-2024-23334 |
| Alpine:v3.21 | py3-aiohttp | 3.9.3-r0 | ALPINE-CVE-2024-23334 |
| Alpine:v3.22 | py3-aiohttp | 3.9.3-r0 | ALPINE-CVE-2024-23334 |
| Alpine:v3.23 | py3-aiohttp | 3.9.3-r0 | ALPINE-CVE-2024-23334 |
| Alpine:v3.24 | py3-aiohttp | 3.9.3-r0 | ALPINE-CVE-2024-23334 |
| Debian:12 | python-aiohttp | 3.8.4-1+deb12u1 | DSA-5828-1 |
| Debian:12 | python-aiohttp | 3.8.4-1+deb12u1 | DEBIAN-CVE-2024-23334 |
| Debian:13 | python-aiohttp | 3.9.5-1 | DEBIAN-CVE-2024-23334 |
| Debian:14 | python-aiohttp | 3.9.5-1 | DEBIAN-CVE-2024-23334 |
| PyPI | aiohttp | 3.9.2 | PYSEC-2024-24 |
| PyPI | aiohttp | 3.9.2 | GHSA-5h86-8mv2-jq9f |
| Ubuntu:22.04:LTS | python-aiohttp | 3.8.1-4ubuntu0.2 | USN-6991-1 |
| Ubuntu:22.04:LTS | python-aiohttp | 3.8.1-4ubuntu0.2 | UBUNTU-CVE-2024-23334 |
| Ubuntu:24.04:LTS | python-aiohttp | 3.9.1-1ubuntu0.1 | UBUNTU-CVE-2024-23334 |
| Ubuntu:24.04:LTS | python-aiohttp | 3.9.1-1ubuntu0.1 | USN-6991-1 |
| Ubuntu:25.10 | python-aiohttp | no fix listed | UBUNTU-CVE-2024-23334 |
| Ubuntu:26.10 | python-aiohttp | no fix listed | UBUNTU-CVE-2024-23334 |
Affected products (as reported)
Weakness: CWE-22 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
References
- https://github.com/aio-libs/aiohttp/security/advisories/GHSA-5h86-8mv2-jq9f x_refsource_CONFIRM
- https://github.com/aio-libs/aiohttp/pull/8079 x_refsource_MISC
- https://github.com/aio-libs/aiohttp/commit/1c335944d6a8b1298baf179b7c0b3069f10c514b x_refsource_MISC
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XXWVZIVAYWEBHNRIILZVB3R3SDQNNAA7/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ICUOCFGTB25WUT336BZ4UNYLSZOUVKBD/
- https://lists.debian.org/debian-lts-announce/2025/02/msg00002.html
- https://www.exploit-db.com/exploits/52474