CVE-2024-27306
JSON

6.1medium

aiohttp vulnerable to XSS on index pages for static file handling

Severity
6.1medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.89% (higher than 57% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-7gpw-8wmc-pm8gPYSEC-2026-1102

Description

aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. A XSS vulnerability exists on index pages for static file handling. This vulnerability is fixed in 3.9.4. We have always recommended using a reverse proxy server (e.g. nginx) for serving static files. Users following the recommendation are unaffected. Other users can disable `show_index` if unable to upgrade.

Affected

Product or packageVersionsReported by
aio-libs aiohttp< 3.9.4CVE List
aiohttp aiohttpbefore 3.9.4CVE List, NVD
aiohttp (PyPI)before 3.9.4GitHub Advisory Database, PyPA Advisory Database
fedoraproject fedora38, 39, 40NVD

All scores

GitHub_M6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
GitHub6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
PyPA Advisory Database6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-79CWE-80

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. A XSS vulnerability exists on index pages for static file handling. This vulnerability is fixed in 3.9.4. We have always recommended using a reverse proxy server (e.g. nginx) for serving static files. Users following the recommendation are unaffected. Other users can disable `show_index` if unable to upgrade.

GitHub Advisory Database
Summary

A XSS vulnerability exists on index pages for static file handling.

Details

When using web.static(..., show_index=True), the resulting index pages do not escape file names.

If users can upload files with arbitrary filenames to the static directory, the server is vulnerable to XSS attacks.

Workaround

We have always recommended using a reverse proxy server (e.g. nginx) for serving static files. Users following the recommendation are unaffected.

Other users can disable show_index if unable to upgrade.


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

NVD (es)

aiohttp es un framework cliente/servidor HTTP asíncrono para asyncio y Python. Existe una vulnerabilidad XSS en las páginas de índice para el manejo de archivos estáticos. Esta vulnerabilidad se solucionó en 3.9.4. Siempre hemos recomendado utilizar un servidor proxy inverso (por ejemplo, nginx) para servir archivos estáticos. Los usuarios que sigan la recomendación no se verán afectados. Otros usuarios pueden desactivar `show_index` si no pueden actualizar.

References

https://github.com/aio-libs/aiohttp/security/advisories/GHSA-7gpw-8wmc-pm8gvendor-advisory, web
https://github.com/aio-libs/aiohttp/pull/8319issue-tracking, web
https://github.com/aio-libs/aiohttp/commit/28335525d1eac015a7e7584137678cbb6ff19397patch, web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2EXRGTN2WG7VZLUZ7WOXU5GQJKCPPHKP/mailing-list
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NWEI6NIHZ3G7DURDZVMRK7ZEFC2BTD3U/mailing-list
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZIVBMPEY7WWOFMC3CWXFBRQPFECV4SW3/mailing-list
https://lists.debian.org/debian-lts-announce/2025/02/msg00002.htmlweb
https://nvd.nist.gov/vuln/detail/CVE-2024-27306advisory
https://github.com/aio-libs/aiohttp/pull/8319/filesweb
https://github.com/aio-libs/aiohttppackage
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2EXRGTN2WG7VZLUZ7WOXU5GQJKCPPHKPweb
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NWEI6NIHZ3G7DURDZVMRK7ZEFC2BTD3Uweb

Sources

SourceRecordLicence
CVE ListCVE-2024-27306 changed 2025-11-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-7gpw-8wmc-pm8g changed 2026-09-10CC-BY-4.0
NVDCVE-2024-27306 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1102 changed 2026-07-07CC-BY-4.0