# CVE-2024-52303: PYSEC-2026-1096 - aiohttp has a memory leak when middleware is enabled when requesting a resource with a non-allowed method

Source: https://junglewise.ai/threats/cve-2024-52303-aiohttp-memory-leak-in-middleware-with-non-allowed-http-methods  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-07. Updated: 2026-09-26  
License: CC BY 4.0 with a link back

CVE-2024-52303 · Severity: low · CVSS 3.1 · Published 2026-07-07

aiohttp is a popular Python HTTP client and server library. When middleware is enabled and a request uses an HTTP method not allowed for a resource, a memory leak occurs due to improper cache cleanup. An attacker can exploit this by sending hundreds of thousands to millions of such requests, exhausting server memory and causing service unavailability.

Technologies: [aiohttp (PyPI)](https://junglewise.ai/threats/technologies/aiohttp). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2024-52303 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-52303 being exploited in the wild.

**How severe is CVE-2024-52303?** Low severity, with a CVSS score of 3.1, published 7 July 2026.

**Which products and versions are affected?** aiohttp (PyPI) ECOSYSTEM:introduced=3.10.6,fixed=3.10.11.

**Is there a fix for CVE-2024-52303?** Yes. aiohttp (PyPI): upgrade to 3.10.11 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-52303 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2024-52303?** Check whether you run aiohttp (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- aiohttp (PyPI): upgrade to 3.10.11 or later

  ```sh
  pip install "aiohttp>=3.10.11"
  ```


## Technical details

This vulnerability is a resource leak (CWE-772) that occurs when a MatchInfoError is generated in response to requests with non-allowed HTTP methods on resources when middleware is active. The root cause is improper cache management—each unique MatchInfoError produces a new cache entry that is never freed, causing unbounded memory growth. The attack is unauthenticated and requires only network access; an attacker can trigger many cache entries by sending repeated requests with various disallowed HTTP methods. An attacker can achieve denial of service by exhausting available memory on the server. The vulnerability was fixed in version 3.10.11 (commit bc15db6).

## Affected products

- aio-libs aiohttp 3.10.6 through 3.10.10

## Identifiers

- CVE-2024-52303
- GHSA-27mf-ghqm-j3j8
- PYSEC-2026-1096

## Timeline

- 2024-11-18: disclosed
- 2024-11-18: patched: Version 3.10.11 released with fix

## References

- [https://github.com/aio-libs/aiohttp/security/advisories/GHSA-27mf-ghqm-j3j8](https://github.com/aio-libs/aiohttp/security/advisories/GHSA-27mf-ghqm-j3j8)

## Related threats

- [aiohttp HTTP request smuggling in pure Python parser](https://junglewise.ai/threats/cve-2026-111750-aiohttp-is-an-asynchronous-http-client-server-framework-for)
- [aiohttp host-only cookie scope bypass in subdomain handling](https://junglewise.ai/threats/cve-2026-111749-aiohttp-is-an-asynchronous-http-client-server-framework-for)
- [aiohttp Request scheme manipulation in absolute-form requests](https://junglewise.ai/threats/cve-2026-111748-aiohttp-is-an-asynchronous-http-client-server-framework-for)
- [AIOHTTP multipart request file descriptor exhaustion](https://junglewise.ai/threats/cve-2026-111066-aiohttp-is-an-asynchronous-http-client-server-framework-for)
- [aiohttp cookie Max-Age integer overflow causes connection pool exhaustion](https://junglewise.ai/threats/cve-2026-111065-aiohttp-is-an-asynchronous-http-client-server-framework-for)
