MONAI Arbitrary Code Execution Vulnerability via Insecure Checkpoint Loading

Vulnerability

A vulnerability allowing arbitrary code execution has been identified in MONAI (Medical Open Network for AI) versions through 1.5.0. The issue arises from insecure loading methods in the 'monai/bundle/scripts.py' file, particularly when loading checkpoints. This vulnerability exploits a deserialization flaw by allowing the execution of malicious payloads embedded in pre-trained models, downloaded from platforms like Hugging Face, to be executed. As of now, no fixed versions are available.

Impact

Exploitation of this vulnerability leads to arbitrary command execution on the system.

Reproduction

The vulnerability can be reproduced by creating a malicious PyTorch checkpoint that includes a payload designed to execute a command, such as creating a file in the '/tmp' directory. This checkpoint can then be loaded using MONAI's CheckpointLoader, which will execute the embedded command. Despite an error indicating a mismatch in the expected checkpoint format, the malicious command execution still occurs.

Remediation

Users are advised to use secure methods for loading checkpoints, such as forcing the 'weights_only' parameter to 'True', or to update to a version of MONAI that addresses this vulnerability, if available.

Added: Sep 9, 2025, 12:17 AM
Updated: Sep 9, 2025, 12:17 AM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
10.0
exploitability
6.6
remediation
0.0
relevance
0.5
threat
6.4
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.