CVE-2024-42367: Aiohttp Path Traversal Vulnerability
MODERATECVE-2024-42367 is a MODERATE (CVSS 4.8) path traversal vulnerability (CWE-61: UNIX Symbolic Link (Symlink) Following) affecting Aiohttp libraries in the PyPI ecosystem. The issue involves in aiohttp, compressed files as symlinks are not protected from path traversal. Remediation is available by upgrading affected packages to version 3.10.2.
CVE-2024-42367 at a Glance
Security Impact
CVSS: 4.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N).
How to Fix CVE-2024-42367
To remediate this vulnerability, upgrade all affected Aiohttp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install aiohttp>=3.10.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show aiohttp
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-42367, inspect your installed packages using pip:
pip show aiohttp
Analyze the terminal output to locate any version of Aiohttp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.10.2), your application is affected.
Note: The pip show aiohttp command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-61: UNIX Symbolic Link (Symlink) Following, where the product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. this could allow an attacker to cause the product to operate on unauthorized files. In Aiohttp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-42367 Affected Aiohttp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
aiohttp
|
PyPI |
≥ 3.10.0b1
< 3.10.2
|
3.10.2
|
References
Frequently Asked Questions
What is CVE-2024-42367?
Which Aiohttp versions are affected?
What version fixes CVE-2024-42367?
Is aiohttp affected?
What is the CVSS score of CVE-2024-42367?
What CWE is associated with CVE-2024-42367?
How can I check PyPI dependencies for CVE-2024-42367?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jwhx-xcg6-8xhj",
"modified" : "2025-06-09T12:17:20Z",
"published" : "2024-08-09T16:49:58Z",
"aliases" : [ "CVE-2024-42367" ],
"summary" : "In aiohttp, compressed files as symlinks are not protected from path traversal",
"details" : "### Summary\nStatic 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.\n\n### Details\nThe 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.\n\n### Impact\nServers 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.\n\n----\n\nPatch: https://github.com/aio-libs/aiohttp/pull/8653/files",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "aiohttp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.10.0b1"
}, {
"fixed" : "3.10.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/aio-libs/aiohttp/security/advisories/GHSA-jwhx-xcg6-8xhj"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-42367"
}, {
"type" : "WEB",
"url" : "https://github.com/aio-libs/aiohttp/pull/8653"
}, {
"type" : "WEB",
"url" : "https://github.com/aio-libs/aiohttp/commit/ce2e9758814527589b10759a20783fb03b98339f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/aio-libs/aiohttp"
}, {
"type" : "WEB",
"url" : "https://github.com/aio-libs/aiohttp/blob/e0ff5246e1d29b7710ab1a2bbc972b48169f1c05/aiohttp/web_fileresponse.py#L177"
}, {
"type" : "WEB",
"url" : "https://github.com/aio-libs/aiohttp/blob/e0ff5246e1d29b7710ab1a2bbc972b48169f1c05/aiohttp/web_urldispatcher.py#L674"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-61" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-08-09T16:49:58Z",
"nvd_published_at" : "2024-08-12T13:38:34Z"
}
}