CVE-2024-9056
Executive Summary
CVE-2024-9056 is a high-severity Denial of Service (DoS) vulnerability affecting BentoML version v1.3.4post1. The flaw allows an unauthenticated attacker to cause excessive resource consumption by appending characters, such as dashes (-), to the end of a multipart boundary in an HTTP request. This forces the server to continuously process each appended character, leading to service unavailability. The vulnerability requires no user interaction and impacts all users of the service. No patch is currently available, and no public exploit code has been released.
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
BentoML is a Python-based open-source framework for building and deploying machine learning models. This vulnerability affects the core server component, which is distributed via PyPI. Users should monitor the official BentoML repository for patch announcements and consider implementing temporary mitigations.
CVSS Breakdown & Threat Level
- CVSS Score: 7.5 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: None (I:N)
- Availability Impact: High (A:H)
The high availability impact and low attack complexity make this a significant threat for production environments.
Deep Dive & Mechanics
The vulnerability resides in BentoML's HTTP multipart request handling. When a multipart boundary is appended with characters (e.g., dashes), the server's parser enters a state where it attempts to process each character individually. This is likely due to a lack of input validation or improper boundary termination logic. The parser does not recognize the boundary as invalid and continues to iterate over the appended characters, consuming CPU and memory resources linearly with the length of the appended string. An attacker can send a single request with a long string of dashes appended to the boundary, causing the server to hang or crash.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code path is in the multipart parsing logic. A hypothetical fix would involve validating the boundary string length and rejecting requests with malformed boundaries.
Vulnerable (v1.3.4post1):
# Hypothetical vulnerable code
def parse_multipart_boundary(boundary):
# No length check or validation
while boundary:
process_character(boundary[0])
boundary = boundary[1:]
Patched (hypothetical):
# Hypothetical patched code
def parse_multipart_boundary(boundary):
if len(boundary) > MAX_BOUNDARY_LENGTH:
raise InvalidRequest("Boundary too long")
# Additional validation
if not boundary.isalnum():
raise InvalidRequest("Invalid boundary characters")
while boundary:
process_character(boundary[0])
boundary = boundary[1:]
Exploitation & Lab Setup
Red Team
To exploit this vulnerability, an attacker sends an HTTP POST request with a multipart boundary that has a long string of dashes appended. Example using curl:
curl -X POST http://target:3000/ \
-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary" \
--data-binary $'------WebKitFormBoundary------------------------------------------------------------\r\nContent-Disposition: form-data; name="file"\r\n\r\nfile content\r\n------WebKitFormBoundary--\r\n'
The attacker can automate this with a script to send multiple requests, amplifying the DoS effect.
Blue Team
To detect exploitation attempts, monitor for HTTP requests with unusually long multipart boundaries. Use the following Suricata rule to alert on such traffic:
alert http any any -> any any (msg:"CVE-2024-9056 - BentoML DoS Attempt"; flow:to_server; content:"multipart/form-data"; http_header_names; content:"boundary"; http_header_names; pcre:"/boundary=[^\r\n]{100,}/"; sid:1000001; rev:1;)
Indicators of Compromise (IOCs)
- Network: HTTP POST requests with multipart boundaries exceeding 100 characters.
- System: High CPU usage on BentoML server processes.
- Logs: Repeated
Invalid boundaryor timeout errors in server logs.
Detection Engineering
YARA Rule
rule CVE_2024_9056_BentoML_DoS {
meta:
description = "Detects HTTP requests with long multipart boundaries targeting BentoML"
author = "Valters IT"
date = "2024-10-01"
reference = "CVE-2024-9056"
strings:
$boundary = /boundary=[^\r\n]{100,}/ nocase
condition:
$boundary
}
Sigma Rule
title: CVE-2024-9056 BentoML DoS Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects HTTP requests with long multipart boundaries targeting BentoML
author: Valters IT
date: 2024/10/01
logsource:
category: webserver
product: generic
detection:
selection:
http.method: 'POST'
http.content_type|contains: 'multipart/form-data'
http.content_type|re: 'boundary=[^\r\n]{100,}'
condition: selection
falsepositives:
- Legitimate large file uploads with long boundaries (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-9056 - BentoML DoS Attempt"; flow:to_server; content:"multipart/form-data"; http_header_names; content:"boundary"; http_header_names; pcre:"/boundary=[^\r\n]{100,}/"; sid:1000001; rev:1;)
Remediation & Mitigation
Since no official patch is available, implement the following mitigations:
- Rate Limiting: Apply rate limiting on HTTP POST requests to the BentoML server.
- Input Validation: Use a reverse proxy (e.g., Nginx) to validate and reject requests with multipart boundaries exceeding a reasonable length (e.g., 100 characters).
- Web Application Firewall (WAF): Deploy a WAF rule to block requests with suspiciously long boundaries.
- Monitor: Continuously monitor server resource usage and logs for signs of exploitation.
- Update: Watch the official BentoML repository for a patch and apply it as soon as available.
Valters IT