NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
MEDIUM severity

CVE-2024-27306 — aiohttp

MEDIUMFix: aio-libs/aiohttp@2833552

CVE-2024-27306 is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in aiohttp. A fix is available for aiohttp — see the affected versions and patch details below.

aiohttp vulnerable to XSS on index pages for static file handling

Also known asGHSA-7gpw-8wmc-pm8gPYSEC-2026-1102
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Oct 29, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2024-27306.

EPSS Exploitation Probability

via FIRST.org ↗
0.7%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs52th percentile — riskier than 52% of all scored CVEsHighest risk
0.17%0.53%0.89%1.25%0.7%0.7%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

1 pkg affected
🐍aiohttp

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

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

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIaiohttpall versions3.9.4pip install --upgrade 'aiohttp==3.9.4'

Affected Products

2 products · 4 configurations
Application
aiohttpaiohttp
< 3.9.4
range
OS
fedorafedoraproject
3 versions
383940

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for aiohttp, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update aiohttp to 3.9.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-27306 is resolved across your whole dependency graph.

  3. Workarounds

    Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatModerate
ProductFixed inAdvisory
Red Hat Ansible Automation Platform 2.4 for RHEL 8python3x-aiohttp-0:3.9.5-1.el8apRHSA-2024:3781
Red Hat Satellite 6.15 for RHEL 8python-aiohttp-0:3.9.4-1.el8pcRHSA-2024:5662
RHUI 4 for RHEL 8python-aiohttp-0:3.9.4-1.el8uiRHSA-2025:1335
UbuntuMEDIUM

Frequently Asked Questions

### 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/file
O3 Security · Impact-Aware SCA

Is CVE-2024-27306 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2024-27306: aiohttp XSS — Fixed in 3.9.4