Exploiting CVE-2025โ€“27520 โ€” BentoML 1.4.2 Remote Code Execution

๐Ÿงญ Step 1: Service Enumeration

Started with aggressive Nmap scanning:

nmap -sCV -A โ€” min-rate 1000 192.168.xx.xx

Explanation:

  • -sC โ†’ Default NSE scripts
  • -sV โ†’ Version detection
  • -A โ†’ Aggressive scan (OS + scripts + traceroute)
  • โ€” min-rate 1000 โ†’ Faster scan speed
None

Scan revealed:

Web service running on port 3000

Accessing:

http://192.168.xx.xx:3000

None

Identified the service as:

BentoML 1.4.2

None

๐Ÿ”Ž Step 2: Vulnerability Identification

After identifying the service version, vulnerability research pointed to:

CVE-2025โ€“27520

This vulnerability allows crafted input to trigger server-side command execution under specific conditions due to improper request validation.

Key Issue:

  • Unsafe handling of user input
  • Backend execution context exposure
None

๐Ÿ’ฅ Step 3: Exploit Preparation

Located public proof-of-concept exploit code.

Steps performed:

1๏ธโƒฃ Copied the exploit script 2๏ธโƒฃ Modified payload section with attacker IP and port 3๏ธโƒฃ Verified target URL and endpoint

None

Example execution:

python3 exploit.py

None

The exploit sent a malicious request to the BentoML service, triggering command execution.

๐ŸŽง Step 4: Listener Setup

On attacker machine:

nc -lvnp 1234

After running the exploit script, a reverse shell connection was received.

None

๐Ÿ–ฅ Step 5: Shell Verification

Once connected:

whoami id uname -a

Confirmed remote command execution on the target system.

๐Ÿ Final Outcome

โœ”๏ธ Service Enumeration โœ”๏ธ Version Identification โœ”๏ธ CVE Research โœ”๏ธ Exploit Customization โœ”๏ธ Remote Code Execution โœ”๏ธ Shell Access

๐ŸŽฅ Full Practical Demonstration For a complete step-by-step video walkthrough, watch here:

3๏ธโƒฃ Verified target URL and endpoint