CVE-2024-30251: aiohttp Denial of Service Vulnerability

aiohttp Updated 02 Oct 2025

Summary

03/05/2024
Yes i
High
7.5

CVE-2024-30251: aiohttp vulnerable to Denial of Service when trying to parse malformed POST requests. Affects aiohttp versions < 3.9.4. Fixed in 3.9.4. How to fix ↓

Also tracked for

The same CVE-2024-30251 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

aiohttp is a Python library for building HTTP-based applications. It provides an asynchronous HTTP client and server implementation. The library is widely used for developing web applications and APIs. aiohttp versions prior to 3.9.4 are vulnerable to a Denial of Service (DoS) attack when processing malformed POST requests.

Vulnerability Detail

The vulnerability arises when an attacker sends a specially crafted POST request with multipart/form-data content. When the aiohttp server attempts to process this request, it enters an infinite loop and becomes unable to handle any further requests. This results in a DoS condition, where the application is effectively stopped from serving any requests after receiving a single malicious request.

How To Fix

Latest published version: 3.14.5 as of 22 Oct 2026

pip install --upgrade "aiohttp==3.14.5"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.9.4

This is the first release that contains the fix.

pip install --upgrade "aiohttp==3.9.4"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, a temporary workaround can be applied by modifying the _read_chunk_from_length() function in the aiohttp/multipart.py file. The following diff shows the necessary changes:

--- a/aiohttp/multipart.py
+++ b/aiohttp/multipart.py
@@ -338,6 +338,8 @@ class BodyPartReader:
     assert self._length is not None, "Content-Length required for chunked read"
     chunk_size = min(size, self._length - self._read_bytes)
     chunk = await self._content.read(chunk_size)
+    if self._content.at_eof():
+        self._at_eof = True
     return chunk
 
 async def _read_chunk_from_stream(self, size: int) -> bytes:

Please note that applying this workaround may introduce minor issues with handling form data. It is recommended to backport the changes mentioned in the provided links if possible.

Conclusion

The aiohttp library versions prior to 3.9.4 are susceptible to a Denial of Service vulnerability. It is crucial to upgrade to the latest version or apply the provided workaround to mitigate the risk. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for aiohttp →

Share this vulnerability

FAQ

aiohttp is a Python library used for building HTTP-based applications. It provides an asynchronous HTTP client and server implementation.

An attacker can exploit this vulnerability to send a single malicious request that causes the aiohttp server to enter an infinite loop. As a result, the application becomes unresponsive and unable to serve any further requests.

To fix this vulnerability, upgrade to aiohttp version 3.9.4 or later. Alternatively, apply the provided workaround if immediate upgrade is not possible.

Yes, versions prior to 3.9.4 are vulnerable to this DoS vulnerability.

Yes, the CVSS score for this vulnerability is 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Related vulnerabilities

Recent vulnerabilities recorded for aiohttp.

How To Fix

Latest published version: 3.14.5 as of 22 Oct 2026

pip install --upgrade "aiohttp==3.14.5"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.9.4

This is the first release that contains the fix.

pip install --upgrade "aiohttp==3.9.4"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback