CVE-2026-118683
Remote code execution via malicious logging.conf in MONAI ConfigWorkflow init.
- CVSS 8.6
- CWE-94
- Input Validation and Sanitization
- Remote
MONAI from 1.2.0 before 1.6.1 contains a remote code execution vulnerability in ConfigWorkflow.__init__, which passes a bundle's configs/logging.conf to logging.config.fileConfig that eval()s handler class and args fields. Attackers can publish a malicious bundle whose logging.conf runs arbitrary Python at workflow construction when a victim loads or runs the bundle.
- CWE
- CWE-94
- CVSS base score
- 8.6
- Published
- 2026-10-28
- OWASP
- A03 Injection
- Orthogonal defect classification
- Interface
- Code defect classification
- Incorrect Interface
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- MONAI
- Fixed by upgrading
- Yes
Solution
Upgrade MONAI to version 1.6.1 or later.
Vulnerable code sample
import os
import logging.config
class ConfigWorkflow:
def __init__(self, bundle_dir):
# Load logging configuration from the bundle
logging_conf = os.path.join(bundle_dir, "configs", "logging.conf")
# VULNERABLE: fileConfig evaluates handler class strings, allowing RCE
logging.config.fileConfig(logging_conf, disable_existing_loggers=False)
self.logger = logging.getLogger("workflow")Patched code sample
import os
import logging
import configparser
class ConfigWorkflow:
def __init__(self, bundle_dir):
# Load logging configuration from the bundle safely
logging_conf = os.path.join(bundle_dir, "configs", "logging.conf")
# FIX: parse config manually and use dictConfig to avoid eval()
parser = configparser.ConfigParser()
parser.read(logging_conf)
dict_cfg = {
"version": 1,
"formatters": {
"default": {"format": parser.get("formatter_default", "format", fallback="%(levelname)s:%(name)s:%(message)s")}
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "default",
"level": parser.get("handler_console", "level", fallback="INFO"),
"stream": "ext://sys.stdout",
}
},
"loggers": {
"workflow": {"handlers": ["console"], "level": "DEBUG", "propagate": False}
},
}
logging.config.dictConfig(dict_cfg)
self.logger = logging.getLogger("workflow")Cite this entry
@misc{vaitp:cve2026118683,
title = {{Remote code execution via malicious logging.conf in MONAI ConfigWorkflow init.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-118683},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-118683/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
