CVE-2024-52303
JSON

8.7high

aiohttp memory leak when middleware is enabled when requesting a resource with a non-allowed method

Severity
8.7high CVSS:4.0 by GitHub_M
Exploit likelihood
0.59% (higher than 49% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-27mf-ghqm-j3j8PYSEC-2026-1096

Description

aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. In versions starting with 3.10.6 and prior to 3.10.11, a memory leak can occur when a request produces a MatchInfoError. This was caused by adding an entry to a cache on each request, due to the building of each MatchInfoError producing a unique cache entry. An attacker may be able to exhaust the memory resources of a server by sending a substantial number (100,000s to millions) of such requests. Those who use any middlewares with aiohttp.web should upgrade to version 3.10.11 to receive a patch.

Affected

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

All scores

GitHub_M8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CISA-ADP7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
PyPA Advisory Database7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Classification

CWE-772

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

What each source says

CVE List

aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. In versions starting with 3.10.6 and prior to 3.10.11, a memory leak can occur when a request produces a MatchInfoError. This was caused by adding an entry to a cache on each request, due to the building of each MatchInfoError producing a unique cache entry. An attacker may be able to exhaust the memory resources of a server by sending a substantial number (100,000s to millions) of such requests. Those who use any middlewares with aiohttp.web should upgrade to version 3.10.11 to receive a patch.

GitHub Advisory Database
Summary

A memory leak can occur when a request produces a MatchInfoError. This was caused by adding an entry to a cache on each request, due to the building of each MatchInfoError producing a unique cache entry.

Impact

If the user is making use of any middlewares with aiohttp.web then it is advisable to upgrade immediately.

An attacker may be able to exhaust the memory resources of a server by sending a substantial number (100,000s to millions) of such requests.


Patch: https://github.com/aio-libs/aiohttp/commit/bc15db61615079d1b6327ba42c682f758fa96936

NVD (es)

aiohttp es un framework de trabajo de cliente/servidor HTTP asincrónico para asyncio y Python. En las versiones a partir de la 3.10.6 y anteriores a la 3.10.11, puede producirse una pérdida de memoria cuando una solicitud produce un MatchInfoError. Esto se debía a que se añadía una entrada a una memoria caché en cada solicitud, debido a que la creación de cada MatchInfoError producía una entrada de memoria caché única. Un atacante podría agotar los recursos de memoria de un servidor enviando una cantidad sustancial (entre cientos y millones) de dichas solicitudes. Quienes utilicen cualquier middleware con aiohttp.web deberían actualizar a la versión 3.10.11 para recibir un parche.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-52303 changed 2024-11-19CVE Terms of Use
GitHub Advisory DatabaseGHSA-27mf-ghqm-j3j8 changed 2026-09-10CC-BY-4.0
NVDCVE-2024-52303 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1096 changed 2026-07-07CC-BY-4.0