CVE-2026-106440 Hydra: Optuna custom_search_space can resolve and execute untrusted callables via get_method

High 7.8 Published Updated

Attackers controlling Optuna sweep configurations can execute arbitrary Python code via untrusted callables in Hydra's custom search space.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-106440?

CVE-2026-106440 is a high-severity code injection vulnerability in hydra-ecosystem hydra, published on 6 Oct 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

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.custom_search_space, resolves it with hydra.utils.get_method(), and later invokes the returned callable in the Hydra controller process. Because get_method() 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.

Weakness: CWE-470

Which versions are affected by CVE-2026-106440?

5 open source packages ship an affected version, including hydra-optuna-sweeper.

PackageAffectedFixed in
hydra-optuna-sweeper PyPIFrom 1.2.01.3.0, 1.4.0.dev10
hydra-optuna-sweeper PyPIFrom 1.2.01.3.0
hydra-optuna-sweeper PyPIFrom 1.2.01.3.0
hydra-optuna-sweeper PyPIFrom 1.4.0.dev41.4.0.dev10
hydra-optuna-sweeper PyPIFrom 1.4.0.dev41.4.0.dev10

How do I fix CVE-2026-106440?

Upgrade hydra-optuna-sweeper to a fixed version for your release line: 1.3.0 or 1.4.0.dev10.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-106440 being exploited?

There is no known exploitation of CVE-2026-106440 in the wild and no public exploit code.

Sources

Also known as GHSA-5jjj-9xc3-rm56, PYSEC-2026-4224.

Is CVE-2026-106440 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free