Bzt: aiohttp has a memory leak when middleware is enabled when requesting a resource with a non-allowed method (CVE-2024-52303)
Description
A memory leak vulnerability exists in aiohttp when middleware is enabled and a request triggers a MatchInfoError due to a non-allowed HTTP method. This occurs because each MatchInfoError creates a unique cache entry, causing unbounded memory growth. An attacker could exploit this by sending large volumes of such requests, potentially exhausting server memory. A patch is available to address this issue.
CVSS v3.1
Score 7.5high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2024-52303 describes a memory leak in aiohttp's web framework when middleware is enabled and a request results in a MatchInfoError. The leak is caused by the creation of unique cache entries for each MatchInfoError instance, leading to continuous memory consumption. This vulnerability allows an attacker to exhaust server memory by sending a high volume of requests with disallowed HTTP methods. The issue affects versions >=1.16.35 and <1.16.35_1 of the bzt product. A patch fixing this leak has been released and is available in the aiohttp GitHub repository.
Potential Impact
The vulnerability can cause denial of service by exhausting the server's memory resources, impacting availability. There is no confidentiality or integrity impact reported. Exploitation requires sending a large number of requests that trigger MatchInfoError, which can be done without authentication or user interaction.
Mitigation Recommendations
An official patch is available and should be applied immediately to affected versions. Users of aiohttp with middleware enabled are advised to upgrade to the fixed version to prevent memory exhaustion attacks. No additional mitigations are specified by the vendor.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-bzt-CVE-2024-52303
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 3.1
Threat ID: 6acaad9c2cdf04f656514543
Added to database: 10/10/2026, 21:26:52 UTC
Last enriched: 10/10/2026, 21:40:24 UTC
Last updated: 10/10/2026, 21:40:24 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.