CVE-2024-42367: In aiohttp, compressed files as symlinks are not protected from path traversal

Published Aug 9, 2024
·
Updated

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 followsymlinks=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

Other sources

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 followsymlinks=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.

— MITRE

Affected Software

6 affected componentsFixes available
pip/aiohttp>=3.10.0b1<3.10.2
3.10.2
aiohttp aiohttp>=3.10.0<3.10.2
debian/python-aiohttp*
debian/python-aiohttp<3.10.3-2
3.10.3-2
debian/python-aiohttp<3.10.3-2
3.10.3-2
debian/python-aiohttp<=3.8.4-1+deb12u1, <=3.8.4-1+deb12u2
3.11.16-1+deb13u13.14.3-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/aiohttp to a version that resolves this vulnerability.

    Fixed in 3.10.2
  2. Upgrade

    Upgrade debian/python-aiohttp to a version that resolves this vulnerability.

    Fixed in 3.10.3-2
  3. Upgrade

    Upgrade debian/python-aiohttp to a version that resolves this vulnerability.

    Fixed in 3.11.16-1+deb13u1Fixed in 3.14.3-1
  4. Upgrade

    Upgrade aiohttp to a version that resolves this vulnerability.

    Fixed in 3.10.2

Event History

Aug 9, 2024
Advisory Published
via GitHub·04:49 PM
Data Sourced
via GitHub·04:49 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·05:25 PM
Data Sourced
via MITRE·05:25 PM
DescriptionSeverityWeakness
Aug 12, 2024
Data Sourced
via NVD·01:38 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·01:38 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-42367?

CVE-2024-42367 has a medium severity rating due to the potential for path traversal vulnerabilities.

2

How do I fix CVE-2024-42367?

To fix CVE-2024-42367, update the aiohttp package to version 3.10.2 or later.

3

What type of vulnerability is CVE-2024-42367?

CVE-2024-42367 is a path traversal vulnerability affecting static routes with symbolic links.

4

Which software is affected by CVE-2024-42367?

CVE-2024-42367 affects the aiohttp package versions prior to 3.10.2.

5

Can CVE-2024-42367 lead to unauthorized access?

Yes, CVE-2024-42367 can potentially allow attackers to access files outside the intended directory.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203