Hydra
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.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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 1.2.0, < 1.3.0
- >= 1.4.0.dev4, < 1.4.0.dev10
Fixed in 1.3.0, 1.4.0.dev10
Mitigation
Upgrade hydra to 1.3.0 or 1.4.0.dev10 or later.
References
- Vendor advisory github.com/hydra-ecosystem/hydra/security/advi…
- Patch github.com/hydra-ecosystem/hydra/commit/0dd180…
- Patch github.com/hydra-ecosystem/hydra/commit/4720df…
1 more
- Release notes github.com/hydra-ecosystem/hydra/releases/tag/…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.