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

Source: https://junglewise.ai/threats/cve-2025-27520-bentoml-insecure-deserialization-remote-code-execution  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-04-04. Updated: 2026-09-26  
License: CC BY 4.0 with a link back

CVE-2025-27520 · Severity: critical · CVSS 9.8 · Published 2025-04-04

BentoML is an open-source platform for building and deploying machine learning services. A critical vulnerability in its deserialization logic allows unauthenticated attackers to execute arbitrary code on servers running BentoML by sending maliciously crafted HTTP requests. This enables complete compromise of the server and any models or data it hosts.

Technologies: [bentoml (PyPI)](https://junglewise.ai/threats/technologies/bentoml). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2025-27520 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-27520 being exploited in the wild.

**How severe is CVE-2025-27520?** Critical severity, with a CVSS score of 9.8, published 4 April 2025.

**Which products and versions are affected?** bentoml (PyPI) >= 1.3.4, < 1.4.3, ECOSYSTEM:introduced=1.3.4,fixed=1.4.3.

**Is there a fix for CVE-2025-27520?** Yes. bentoml (PyPI): upgrade to 1.4.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-27520 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2025-27520?** Check whether you run bentoml (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- bentoml (PyPI): upgrade to 1.4.3 or later

  ```sh
  pip install "bentoml>=1.4.3"
  ```


## Technical details

The vulnerability exists in BentoML's serde.py module, where the deserialize_value() function unsafely calls pickle.loads() on untrusted payload data received from HTTP requests without validation. Pickle deserialization is inherently unsafe as it can execute arbitrary Python code during the deserialization process. The vulnerability is triggered via network requests to any BentoML service endpoint (e.g., POST to /summarize) with a Content-Type header of 'application/vnd.bentoml+pickle' and a crafted pickle payload. No authentication or user interaction is required. An attacker can achieve arbitrary code execution with the privileges of the BentoML process. The vulnerability affects versions 1.3.4 through 1.4.2, and has been patched in version 1.4.3.

## Affected products

- BentoML BentoML >=1.3.4, <1.4.3

## Identifiers

- CVE-2025-27520
- GHSA-33xw-247w-6hmc
- PYSEC-2026-294

## Timeline

- 2025-04-04: disclosed
- 2025-04-04: patched: Version 1.4.3 available

## References

- [https://github.com/bentoml/BentoML/security/advisories/GHSA-33xw-247w-6hmc](https://github.com/bentoml/BentoML/security/advisories/GHSA-33xw-247w-6hmc)

## Related threats

- [bentoml OpenLLM command injection in Model Repository Directory Name Handler](https://junglewise.ai/threats/cve-2026-15035-bentoml-openllm-command-injection-in-model-repository-directory)
- [PYSEC-2026-1218 - BentoML has a Path Traversal via Bentofile Configuration](https://junglewise.ai/threats/cve-2026-24123-bentoml-has-a-path-traversal-via-bentofile-configuration)
- [PYSEC-2026-1219 - BentoML Denial of Service (DoS) via Multipart Boundary](https://junglewise.ai/threats/cve-2024-9056-bentoml-denial-of-service-dos-via-multipart-boundary)
- [BentoML command injection in Dockerfile generation via bentofile.yaml](https://junglewise.ai/threats/cve-2026-44346-bentoml-command-injection-in-dockerfile-generation-via-bentofile)
- [BentoML command injection in Dockerfile base_image template](https://junglewise.ai/threats/cve-2026-44345-bentoml-command-injection-in-dockerfile-base-image-template)
