---
id: CVE-2024-52303
aliases:
  - GHSA-27mf-ghqm-j3j8
  - PYSEC-2026-1096
title: >-
  aiohttp has a memory leak when middleware is enabled when requesting a
  resource with a non-allowed method
summary: >-
  aiohttp has a memory leak when middleware is enabled when requesting a
  resource with a non-allowed method
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'
vendor: aiohttp
product: aiohttp
ecosystem: pip
affected:
  - 'aiohttp >= 3.10.6, < 3.10.11'
patched:
  - aiohttp 3.10.11
published: '2024-11-18'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:50:20.382497140Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-27mf-ghqm-j3j8'
references:
  - url: >-
      https://github.com/aio-libs/aiohttp/security/advisories/GHSA-27mf-ghqm-j3j8
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2024-52303'
  - url: >-
      https://github.com/aio-libs/aiohttp/commit/bc15db61615079d1b6327ba42c682f758fa96936
  - url: 'https://github.com/aio-libs/aiohttp'
tags:
  - osv
  - pip
epss: 0.00591
epssPercentile: 0.46985
ingestedAt: '2026-07-08T18:25:44.173Z'
---

## Overview

### 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

## Affected packages

- `aiohttp >= 3.10.6, < 3.10.11`

## Remediation

Upgrade to a patched release:

- `aiohttp 3.10.11`
