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.

Severity (CVSS 3.1)5.9Medium
Exploit odds (30 days)76.9%top 0.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack tooling2Nuclei, Public PoC

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

EcosystemPackageFixed inAdvisory
Alpine:v3.20py3-aiohttp3.9.3-r0ALPINE-CVE-2024-23334
Alpine:v3.21py3-aiohttp3.9.3-r0ALPINE-CVE-2024-23334
Alpine:v3.22py3-aiohttp3.9.3-r0ALPINE-CVE-2024-23334
Alpine:v3.23py3-aiohttp3.9.3-r0ALPINE-CVE-2024-23334
Alpine:v3.24py3-aiohttp3.9.3-r0ALPINE-CVE-2024-23334
Debian:12python-aiohttp3.8.4-1+deb12u1DSA-5828-1
Debian:12python-aiohttp3.8.4-1+deb12u1DEBIAN-CVE-2024-23334
Debian:13python-aiohttp3.9.5-1DEBIAN-CVE-2024-23334
Debian:14python-aiohttp3.9.5-1DEBIAN-CVE-2024-23334
PyPIaiohttp3.9.2PYSEC-2024-24
PyPIaiohttp3.9.2GHSA-5h86-8mv2-jq9f
Ubuntu:22.04:LTSpython-aiohttp3.8.1-4ubuntu0.2USN-6991-1
Ubuntu:22.04:LTSpython-aiohttp3.8.1-4ubuntu0.2UBUNTU-CVE-2024-23334
Ubuntu:24.04:LTSpython-aiohttp3.9.1-1ubuntu0.1UBUNTU-CVE-2024-23334
Ubuntu:24.04:LTSpython-aiohttp3.9.1-1ubuntu0.1USN-6991-1
Ubuntu:25.10python-aiohttpno fix listedUBUNTU-CVE-2024-23334
Ubuntu:26.10python-aiohttpno fix listedUBUNTU-CVE-2024-23334

Affected products (as reported)

VendorProductVersions
aio-libs aiohttp < 3.9.2

Weakness: CWE-22 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

References