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

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

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **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:** Yes
- **Published:** 6 Oct 2026
- **Updated:** 9 Oct 2026
- **Also known as:** GHSA-5jjj-9xc3-rm56, PYSEC-2026-4224

## 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 (Use of Externally-Controlled Input to Select Classes or Code)

## Which versions are affected by CVE-2026-106440?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `hydra-optuna-sweeper` | PyPI | From 1.2.0 | 1.3.0, 1.4.0.dev10 |
| `hydra-optuna-sweeper` | PyPI | From 1.2.0 | 1.3.0 |
| `hydra-optuna-sweeper` | PyPI | From 1.2.0 | 1.3.0 |
| `hydra-optuna-sweeper` | PyPI | From 1.4.0.dev4 | 1.4.0.dev10 |
| `hydra-optuna-sweeper` | PyPI | From 1.4.0.dev4 | 1.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.

## Is CVE-2026-106440 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-106440 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2026-106440 in the wild and no public exploit code.

Affected packages and fixed versions:
- hydra-optuna-sweeper (PyPI): affected from 1.2.0; fixed in 1.3.0, 1.4.0.dev10
- hydra-optuna-sweeper (PyPI): affected from 1.2.0; fixed in 1.3.0
- hydra-optuna-sweeper (PyPI): affected from 1.2.0; fixed in 1.3.0
- hydra-optuna-sweeper (PyPI): affected from 1.4.0.dev4; fixed in 1.4.0.dev10
- hydra-optuna-sweeper (PyPI): affected from 1.4.0.dev4; fixed in 1.4.0.dev10

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-106440/ (Markdown: https://insights.sbomify.com/CVE-2026-106440/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-106440
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-106440
- OSV: https://osv.dev/vulnerability/CVE-2026-106440

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-106440/
Summaries are generated and may contain mistakes; the official description above is the record.
