CVE-2024-42367
JSON

4.8medium

In aiohttp, compressed files as symlinks are not protected from path traversal

Severity
4.8medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.79% (higher than 53% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-jwhx-xcg6-8xhjPYSEC-2026-1108

Description

aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. In versions on the 3.10 branch prior to version 3.10.2, static routes which contain files with compressed variants (`.gz` or `.br` extension) are vulnerable to path traversal outside the root directory if those variants are symbolic links. The server protects static routes from path traversal outside the root directory when `follow_symlinks=False` (default). It does this by resolving the requested URL to an absolute path and then checking that path relative to the root. However, these checks are not performed when looking for compressed variants in the `FileResponse` class, and symbolic links are then automatically followed when performing the `Path.stat()` and `Path.open()` to send the file. Version 3.10.2 contains a patch for the issue.

Affected

Product or packageVersionsReported by
aio-libs aiohttp>= 3.10.0b1, < 3.10.2CVE List
aiohttp (PyPI)from 3.10.0b1 before 3.10.2GitHub Advisory Database, PyPA Advisory Database
aiohttp aiohttpfrom 3.10.0 before 3.10.2NVD

All scores

GitHub_M4.8medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
GitHub4.8medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
NVD4.8medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
PyPA Advisory Database4.8medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Classification

CWE-61

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. In versions on the 3.10 branch prior to version 3.10.2, static routes which contain files with compressed variants (`.gz` or `.br` extension) are vulnerable to path traversal outside the root directory if those variants are symbolic links. The server protects static routes from path traversal outside the root directory when `follow_symlinks=False` (default). It does this by resolving the requested URL to an absolute path and then checking that path relative to the root. However, these checks are not performed when looking for compressed variants in the `FileResponse` class, and symbolic links are then automatically followed when performing the `Path.stat()` and `Path.open()` to send the file. Version 3.10.2 contains a patch for the issue.

GitHub Advisory Database
Summary

Static routes which contain files with compressed variants (.gz or .br extension) were vulnerable to path traversal outside the root directory if those variants are symbolic links.

Details

The server protects static routes from path traversal outside the root directory when follow_symlinks=False (default). It does this by resolving the requested URL to an absolute path and then checking that path relative to the root. However, these checks are not performed when looking for compressed variants in the FileResponse class, and symbolic links are then automatically followed when performing Path.stat() and Path.open() to send the file.

Impact

Servers with static routes that contain compressed variants as symbolic links, pointing outside the root directory, or that permit users to upload or create such links, are impacted.


Patch: https://github.com/aio-libs/aiohttp/pull/8653/files

NVD (es)

aiohttp es un framework cliente/servidor HTTP asíncrono para asyncio y Python. Antes de la versión 3.10.2, las rutas estáticas que contienen archivos con variantes comprimidas (extensión `.gz` o `.br`) son vulnerables al path traversal fuera del directorio raíz si esas variantes son enlaces simbólicos. El servidor protege las rutas estáticas contra el path traversal fuera del directorio raíz cuando `follow_symlinks=False` (predeterminado). Para ello, resuelve la URL solicitada en una ruta absoluta y luego verifica esa ruta en relación con la raíz. Sin embargo, estas comprobaciones no se realizan cuando se buscan variantes comprimidas en la clase `FileResponse`, y los enlaces simbólicos se siguen automáticamente al realizar `Path.stat()` y `Path.open()` para enviar el archivo. La versión 3.10.2 contiene un parche para el problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-42367 changed 2025-06-09CVE Terms of Use
GitHub Advisory DatabaseGHSA-jwhx-xcg6-8xhj changed 2026-09-10CC-BY-4.0
NVDCVE-2024-42367 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1108 changed 2026-07-07CC-BY-4.0