CVE-2024-23334 aiohttp.web.static(follow_symlinks=True) is vulnerable to directory traversal

Medium 5.9 Published Updated

Attackers can read arbitrary files on the server when aiohttp static routes are configured with follow_symlinks enabled.

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-23334?

CVE-2024-23334 is a medium-severity path traversal vulnerability in Fedoraproject Fedora, published on 29 Jan 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. 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.

Weakness: CWE-22

Which versions are affected by CVE-2024-23334?

3 open source packages ship an affected version, including aiohttp. It affects 2 products.

PackageAffectedFixed in
aiohttp PyPIFrom 1.0.53.9.2
aiohttp PyPIFrom 1.0.53.9.2
aiohttp PyPIFrom 1.0.53.9.2
Linux distribution packages (1)
python-aiohttp openSUSE:TumbleweedAll versions3.9.3-1.1

Products include Aiohttp Aiohttp, Fedoraproject Fedora.

How do I fix CVE-2024-23334?

Upgrade aiohttp to 3.9.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-23334 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-23334 exists.

Public exploit code: 1 Exploit-DB entry, 1 Nuclei template and 15 proofs of concept on GitHub.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as AZL-43552, AZL-44319, CLSA-2026-1788349677, DEBIAN-CVE-2024-23334, ECHO-14a1-a31d-6fee, GHSA-5h86-8mv2-jq9f and 5 more.

Is CVE-2024-23334 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free