CVE-2026-106440: Hydra: Optuna custom_search_space can resolve and execute untrusted callables via get_method
Hydra is a framework for elegantly configuring complex applications. From 1.2.0 until 1.3.0 and 1.4.0.dev10, the hydra-optuna-sweeper package accepts a configuration-controlled dotted path in hydra.sweeper.customsearchspace, resolves it with hydra.utils.getmethod(), and later invokes the returned callable in the Hydra controller process. Because getmethod() is a trusted-input lookup helper and does not apply the execution policy used by instantiate(), an attacker who controls Optuna sweep configuration or command-line overrides can select importable Python code for execution with the application's privileges, including bypassing a trusted execution whitelist on affected Hydra 1.4 development releases. This issue is fixed in versions 1.3.0 and 1.4.0.dev10.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
hydra-optuna-sweeperto a version that resolves this vulnerability.Fixed in 1.3.0 - Upgrade
Upgrade
hydra-optuna-sweeperto a version that resolves this vulnerability.Fixed in 1.4.0.dev10
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using the hydra-optuna-sweeper package are exposed if an attacker can control Optuna sweep configuration or supply command-line overrides that set hydra.sweeper.custom_search_space. The selected callable executes in the Hydra controller process with the application's privileges.
Are default deployments affected?
The issue requires attacker control of the relevant sweep configuration or command-line overrides. The provided information does not indicate that the default custom_search_space setting alone triggers exploitation.
What versions should be used to remediate the issue?
Upgrade to hydra-optuna-sweeper versions 1.3.0 or 1.4.0.dev10, which contain the fix. Affected versions are stated as 1.2.0 until those fixed releases.
What can be done if upgrading is not immediately possible?
Do not allow untrusted parties to modify Optuna sweep configuration or provide command-line overrides controlling hydra.sweeper.custom_search_space. Restrict this setting to trusted, reviewed callable paths.