module

PyTorch Model Server Registration and Deserialization RCE

Disclosed
Oct 3, 2023
Created
Oct 12, 2023

Description

The PyTorch model server contains multiple vulnerabilities that can be chained together to permit an
unauthenticated remote attacker arbitrary Java code execution. The first vulnerability is that the management
interface is bound to all IP addresses and not just the loop back interface as the documentation suggests. The
second vulnerability (CVE-2023-43654) allows attackers with access to the management interface to register MAR
model files from arbitrary servers. The third vulnerability is that when an MAR file is loaded, it can contain a
YAML configuration file that when deserialized by snakeyaml, can lead to loading an arbitrary Java class.

Authors

Idan Levcovich
Guy Kaplan
Gal Elbaz
Swapneil Kumar Dash
Spencer McIntyre

Platform

Java

Architectures

java

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':


msf > use exploit/multi/http/torchserver_cve_2023_43654
msf exploit(torchserver_cve_2023_43654) > show targets
...targets...
msf exploit(torchserver_cve_2023_43654) > set TARGET < target-id >
msf exploit(torchserver_cve_2023_43654) > show options
...show and set options...
msf exploit(torchserver_cve_2023_43654) > exploit

Title
Rapid7 Labs

2026 Global Threat Landscape Report

The predictive window has collapsed. Exploitation follows disclosure in days. See how attackers are accelerating and how to stay ahead.