CVE-2026-106441
Hydra logging config can load arbitrary classes, enabling code execution.
- CVSS 7.8
- CWE-94
- Configuration Issues
- Local
Hydra is a framework for elegantly configuring complex applications. Prior to 1.3.6 and 1.4.0.dev9, Hydra passes Python logging configuration to logging.config.dictConfig() without applying Hydra's target policy to handler class values or formatter, filter, handler, queue, and listener factories. An attacker who controls Hydra logging configuration can therefore select an importable class or factory and cause it to be invoked with the application's privileges, even in versions where instantiate() is protected because the logging path does not use instantiate(). This issue is fixed in versions 1.3.6 and 1.4.0.dev9.
- CWE
- CWE-94
- CVSS base score
- 7.8
- Published
- 2026-10-06
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Interface
- Code defect classification
- Incorrect Interface
- Category
- Configuration Issues
- Subcategory
- Dynamic Link Library (DLL) Loading Issues
- Accessibility scope
- Local
- Impact
- Arbitrary Code Execution
- Affected component
- Hydra
- Fixed by upgrading
- Yes
Solution
Upgrade Hydra to version 1.3.6 or later (or to 1.4.0.dev9 or newer).
Vulnerable code sample
import logging
import logging.config
from omegaconf import OmegaConf
def configure_logging(cfg_path: str):
# Load a YAML logging configuration supplied by the user
user_cfg = OmegaConf.load(cfg_path)
# VULNERABLE: passes unvalidated dict directly to dictConfig, allowing arbitrary class import
logging.config.dictConfig(OmegaConf.to_container(user_cfg, resolve=True))
def main():
configure_logging("logging.yaml")Patched code sample
import logging
import logging.config
from omegaconf import OmegaConf
# Allowed handler classes for logging configuration
_ALLOWED_HANDLER_CLASSES = {
"logging.StreamHandler",
"logging.FileHandler",
"logging.handlers.RotatingFileHandler",
"logging.handlers.QueueHandler",
}
def _validate_logging_cfg(cfg: dict) -> dict:
handlers = cfg.get("handlers", {})
for name, handler_cfg in handlers.items():
cls = handler_cfg.get("class")
if cls not in _ALLOWED_HANDLER_CLASSES:
raise ValueError(f"Disallowed logging handler class: {cls}")
return cfg
def configure_logging(cfg_path: str):
user_cfg = OmegaConf.load(cfg_path)
raw_cfg = OmegaConf.to_container(user_cfg, resolve=True)
# FIX: validates handler classes before passing to dictConfig
safe_cfg = _validate_logging_cfg(raw_cfg)
logging.config.dictConfig(safe_cfg)
def main():
configure_logging("logging.yaml")Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Apply target authorization to logging configuration (hydra-ecosystem/hydra)
hydra/core/utils.py,hydra/core/utils.py · configure_log,hydra/core/utils.py · run_job,hydra/main.py,hydra/main.py · main,hydra/types.py,hydra/utils.py,hydra/_internal/core_plugins/basic_launcher.py · BasicLauncher.launch,hydra/_internal/hydra.py,hydra/_internal/hydra.py · Hydra.multirun,hydra/_internal/hydra.py · Hydra.run,hydra/_internal/instantiate/_instantiate2.pyand 6 more - Harden logging target resolution on 1.3 (#3420) (hydra-ecosystem/hydra)
hydra/core/utils.py · configure_log,hydra/_internal/instantiate/_instantiate2.py,hydra/_internal/instantiate/_instantiate2.py · _resolve_target
Cite this entry
@misc{vaitp:cve2026106441,
title = {{Hydra logging config can load arbitrary classes, enabling code execution.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-106441},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-106441/}}
}
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 ::
