CVE-2024-23334 in aiohttp

LogPulse has a published detection rule for this CVE: it raises a notable when someone tries to exploit it.

What the vulnerability is

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 software: aiohttp, fedoraproject fedora

Scores

What LogPulse has for it

How to mitigate it

Upgrade aiohttp to 3.9.2 or later

Patch or upgrade. aiohttp before 3.9.2 does not keep static routes with follow_symlinks=True inside their root, so a remote user reads any file. Version 3.9.2 checks the resolved path.

Applies to: aiohttp before 3.9.2 used as a web server with static routes and follow_symlinks=True.

  1. Find the aiohttp version with pip show aiohttp in the application environment.
  2. Upgrade with pip install 'aiohttp>=3.9.2' (or the pinned version in requirements) and redeploy.
  3. Remove follow_symlinks=True from add_static routes unless it is really needed.
  4. Serve static files from the reverse proxy where possible.

Sources:

Source data: NIST NVD, CISA KEV and FIRST EPSS. LogPulse processes new CVEs every hour.

We build every detection with great care, but no two environments are the same. Log sources, parsing and configuration differ, so test a detection in your own environment before you rely on it.

Start free with LogPulse