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

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

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Jan 2024
- **Updated:** 4 Feb 2026
- **Also known as:** AZL-43552, AZL-44319, CLSA-2026-1788349677, DEBIAN-CVE-2024-23334, ECHO-14a1-a31d-6fee, GHSA-5h86-8mv2-jq9f, PYSEC-2024-24, ROOT-APP-PYPI-CVE-2024-23334, UBUNTU-CVE-2024-23334, USN-6991-1, openSUSE-SU-2024:13642-1

## 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 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2024-23334?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `aiohttp` | PyPI | From 1.0.5 | 3.9.2 |
| `aiohttp` | PyPI | From 1.0.5 | 3.9.2 |
| `aiohttp` | PyPI | From 1.0.5 | 3.9.2 |
| `python-aiohttp` | openSUSE:Tumbleweed | All versions | 3.9.3-1.1 |

Products: Aiohttp Aiohttp, Fedoraproject Fedora.

## How do I fix CVE-2024-23334?

Upgrade aiohttp to 3.9.2 or later.

## 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:

- aiohttp LFI (CVE-2024-23334) (github_poc): https://github.com/jhonnybonny/CVE-2024-23334
- A proof of concept of the path traversal vulnerability in the python AioHTTP library =< 3.9.1 (github_poc): https://github.com/z3rObyte/CVE-2024-23334-PoC
- CVE-2024-23334 (github_poc): https://github.com/ox1111/CVE-2024-23334
- Proof-of-Concept for LFI/Path Traversal vulnerability in Aiohttp =< 3.9.1 (github_poc): https://github.com/wizarddos/CVE-2024-23334
- https://github.com/sxyrxyy/aiohttp-exploit-CVE-2024-23334-certstream (github_poc): https://github.com/sxyrxyy/aiohttp-exploit-CVE-2024-23334-certstream
- A proof of concept of the LFI vulnerability on aiohttp 3.9.1 (github_poc): https://github.com/s4botai/CVE-2024-23334-PoC

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-52303](https://insights.sbomify.com/CVE-2024-52303/): aiohttp memory leak when middleware is enabled when requesting a resource with a non-allowed method (high 8.7)
- [CVE-2025-69223](https://insights.sbomify.com/CVE-2025-69223/): AIOHTTP's HTTP Parser auto_decompress feature is vulnerable to zip bomb (high 7.5)
- [CVE-2024-30251](https://insights.sbomify.com/CVE-2024-30251/): Denial of service when trying to parse malformed POST requests in aiohttp (high 7.5)
- [CVE-2023-49081](https://insights.sbomify.com/CVE-2023-49081/): aiohttp's ClientSession is vulnerable to CRLF injection via version (high 7.2)
- [CVE-2026-22815](https://insights.sbomify.com/CVE-2026-22815/): AIOHTTP: Uncapped memory usage possible through aiohttp allowing unlimited trailer headers (medium 6.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-23334 and fix it if it is affected.

What it is: 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.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-23334 exists.

Affected packages and fixed versions:
- aiohttp (PyPI): affected from 1.0.5; fixed in 3.9.2
- aiohttp (PyPI): affected from 1.0.5; fixed in 3.9.2
- aiohttp (PyPI): affected from 1.0.5; fixed in 3.9.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-23334/ (Markdown: https://insights.sbomify.com/CVE-2024-23334/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-23334
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-23334
- OSV: https://osv.dev/vulnerability/CVE-2024-23334

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-23334/
Summaries are generated and may contain mistakes; the official description above is the record.
