Skip to main content
Vulnerability Database/CVE-2026-109361

CVE-2026-109361: MONAI nnUNetV2Runner RCE Vulnerability

CVE-2026-109361 is an insecure deserialization flaw in MONAI nnUNetV2Runner that enables remote code execution through malicious pickle files. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-109361 Overview

CVE-2026-109361 is an insecure deserialization vulnerability [CWE-502] in the Medical Open Network for AI (MONAI) framework. Affected versions are MONAI 1.2.0 through 1.6.0, with the fix landing in 1.6.1. The nnUNetV2Runner component unpickles the postprocessing_file path read from inference_information.json without confining it to the results directory. An attacker who can modify inference_information.json can redirect the path to a malicious pickle file anywhere on the filesystem. When predict_ensemble_postprocessing runs, Python deserializes the attacker-controlled payload and executes arbitrary code.

Critical Impact

Local attackers with write access to inference_information.json can achieve arbitrary code execution in the MONAI process context by abusing unrestricted pickle deserialization.

Affected Products

  • MONAI 1.2.0 through 1.6.0 (nnUNetV2Runner component)
  • monai/apps/nnunet/nnunetv2_runner.py module invoking predict_ensemble_postprocessing
  • monai/utils/misc.py pickle allowlist (MONAIEnvVars.allow_pickle)

Discovery Timeline

  • 2026-10-12 - CVE-2026-109361 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-109361

Vulnerability Analysis

MONAI's nnUNetV2Runner orchestrates nnU-Net training and inference workflows. During ensemble postprocessing, the runner reads inference_information.json to locate a serialized postprocessing configuration. The runner then calls load_pickle on the postprocessing_file value without validating that the path resides inside the expected results directory.

Because Python's pickle module executes arbitrary callables through __reduce__ during deserialization, any attacker-controlled pickle file loaded through this path yields code execution. Exploitation requires local access and user interaction to trigger predict_ensemble_postprocessing, but no elevated privileges beyond write access to the JSON file.

Root Cause

The root cause is unvalidated path handling combined with trust in a mutable configuration file. The postprocessing_file field is treated as a trusted path and passed directly into load_pickle. There is no canonicalization, no containment check against the configured results directory, and no opt-in gate requiring the user to acknowledge pickle risk.

Attack Vector

An attacker places a malicious pickle payload on the filesystem and modifies inference_information.json so the postprocessing_file entry references that payload. When a MONAI user subsequently runs ensemble postprocessing through nnUNetV2Runner, the deserialization executes the embedded __reduce__ gadget under the user's identity. Typical targets include shared research workstations, multi-tenant inference pipelines, and CI runners that process untrusted model artifacts.

python
# Patch excerpt - monai/apps/nnunet/nnunetv2_runner.py
 from monai.apps.nnunet.utils import analyze_data, create_new_data_copy, create_new_dataset_json
 from monai.bundle import ConfigParser
 from monai.utils import ensure_tuple, optional_import, require_pkg
-from monai.utils.misc import run_cmd
+from monai.utils.misc import MONAIEnvVars, run_cmd

 load_pickle, _ = optional_import("batchgenerators.utilities.file_and_folder_operations", name="load_pickle")
 join, _ = optional_import("batchgenerators.utilities.file_and_folder_operations", name="join")

# Patch excerpt - monai/utils/misc.py
     @staticmethod
     def allow_pickle() -> bool:
-        """If true, Auto3DSeg algo (de)serialization may use pickle. Default False.
+        """If true, Auto3DSeg algo (de)serialization and nnU-Net postprocessing loading may use
+        pickle. Default False.

         Pickle can execute arbitrary code on load and should only be enabled for files
         from trusted sources. Prefer ``algo_to_json`` / ``algo_from_json``.
# Source: https://github.com/Project-MONAI/MONAI/commit/08576205c4de3c214976294d1dec8f7b2e78cdb9

The patch introduces a MONAIEnvVars.allow_pickle gate and extends its scope to cover nnU-Net postprocessing loads, requiring explicit opt-in before pickle deserialization proceeds.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-109361

Indicators of Compromise

  • Modifications to inference_information.json where the postprocessing_file field references paths outside the configured nnU-Net results directory.
  • Unexpected .pkl or .pickle files written to user-writable locations shortly before nnUNetV2Runner executions.
  • Python processes spawning shells, network clients, or privilege-sensitive binaries during ensemble postprocessing runs.

Detection Strategies

  • Monitor file integrity on inference_information.json and alert on writes from non-pipeline users or service accounts.
  • Instrument MONAI jobs to log the resolved absolute path passed to load_pickle and flag paths that escape the results root.
  • Hunt for child-process creation anomalies from Python interpreters running MONAI modules (monai.apps.nnunet).

Monitoring Recommendations

  • Capture command-line telemetry for python -m monai and nnUNetV2Runner invocations across research and inference hosts.
  • Alert on outbound network connections initiated during postprocessing stages, which should typically be offline operations.
  • Review audit logs for new or modified pickle artifacts in shared dataset directories.

How to Mitigate CVE-2026-109361

Immediate Actions Required

  • Upgrade MONAI to version 1.6.1 or later on every host running nnUNetV2Runner workloads.
  • Audit all existing inference_information.json files and reset any postprocessing_file values that point outside the expected results directory.
  • Restrict write permissions on nnU-Net results directories and configuration JSON files to the owning pipeline identity only.

Patch Information

The fix is delivered in commit 08576205c4de3c214976294d1dec8f7b2e78cdb9 and shipped in MONAI 1.6.1. The patch confines pickle loads to the results directory and gates pickle deserialization behind the MONAIEnvVars.allow_pickle environment flag. Refer to the MONAI GitHub Security Advisory GHSA-8f32-8649-rv87 and the VulnCheck advisory on MONAI RCE for additional details.

Workarounds

  • Leave MONAI_ALLOW_PICKLE unset (default) so pickle-based postprocessing loads remain disabled after upgrade.
  • Run MONAI inference jobs under low-privilege, sandboxed service accounts to limit the blast radius of any deserialization execution.
  • Store inference_information.json on read-only mounts during inference and regenerate it only through trusted pipeline tooling.
bash
# Configuration example - keep pickle loading disabled and verify version
pip install --upgrade "monai>=1.6.1"
unset MONAI_ALLOW_PICKLE
python -c "import monai; print(monai.__version__)"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.