Vulnerabilities in pkg:pypi/hydra-optuna-sweeper

PACKAGE
Advisory Identifier: GHSA-5jjj-9xc3-rm56
Advisory Summary

CVE-2026-106440 is a HIGH (CVSS 7.8) optuna custom_search_space can resolve and vulnerability (CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')) affecting Hydra libraries in the PyPI ecosystem. The issue involves optuna custom_search_space can resolve and execute untrusted callables via get_method. Remediation is available by upgrading affected packages to version 1.3.0, 1.4.0.dev10.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/hydra-optuna-sweeper

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/hydra-optuna-sweeper. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-5jjj-9xc3-rm56 CVE-2026-106440 HIGH Hydra: Optuna custom_search_space can resolve and execute untrusted callables via get_method

CVE-2026-106440 at a Glance

CVE Identifier CVE-2026-106440
GHSA Identifier GHSA-5jjj-9xc3-rm56
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Affected Product Hydra
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-106440

To remediate this vulnerability, upgrade all affected Hydra dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

hydra-optuna-sweeper fixed: 1.3.0
pip install hydra-optuna-sweeper>=1.3.0
hydra-optuna-sweeper fixed: 1.4.0.dev10
pip install hydra-optuna-sweeper>=1.4.0.dev10
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show hydra-optuna-sweeper

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-106440, inspect your installed packages using pip:

pip show hydra-optuna-sweeper

Analyze the terminal output to locate any version of Hydra in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.0), your application is affected.

Note: The pip show hydra-optuna-sweeper command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection'), where the product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code. In Hydra, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary `hydra-optuna-sweeper` accepted a configuration-controlled dotted path in `hydra.sweeper.custom_search_space`, resolved it with the lower-level `hydra.utils.get_method()` API, and later invoked the returned callable. Hydra's object-lookup helpers intentionally trust their input and do not apply the execution policy used by `instantiate()` and logging configuration. As a result, untrusted Optuna multirun configuration could select installed Python code for execution in the Hydra controller process. ## Impact Exploitation requires control of an application's Optuna sweep configuration or command-line overrides and an importable callable in the application's environment. Selected code runs with the privileges of the application. On affected Hydra 1.4 development releases, this path bypasses an execution whitelist provided by trusted application code. Hydra 1.3 has no execution-whitelist security boundary; there, the same change restores the legacy blocklist as defense in depth. ## Fix The Optuna sweeper now resolves the configured callback through `hydra.utils.instantiate()` as a partial callable. On Hydra 1.4, the active execution whitelist therefore authorizes the callback before use. On Hydra 1.3, the legacy blocklist is applied as defense in depth. The public `get_object()`, `get_method()`, `get_static_method()`, and `get_class()` helpers remain lower-level trusted-input APIs. Their documentation now warns against passing values derived from untrusted configuration and directs config-driven construction to `instantiate()`. ## Affected versions - Package: `hydra-optuna-sweeper` - Stable affected range: `>= 1.2.0, < 1.3.0` - Stable fixed version: `1.3.0` - Development affected range: `>= 1.4.0.dev4, < 1.4.0.dev10` - Development fixed version: `1.4.0.dev10` The feature was introduced in `1.2.0` and is absent from the 1.1 release line. The 1.4 development line was affected from 1.4.0.dev4 through 1.4.0.dev9. ## Workaround Treat Optuna sweep configuration and command-line overrides as trusted. Do not set `custom_search_space` from externally controlled input or allow untrusted users to place modules on the application import path. Reported by zx (GitHub: @manus-pi).

CVE-2026-106440 Affected Hydra Versions

2 component(s)
Fixed Versions:
1.3.01.4.0.dev10
Product / Package Ecosystem Affected Versions Fixed Version
hydra-optuna-sweeper
PyPI
≥ 1.2.0
< 1.3.0
1.3.0
hydra-optuna-sweeper
PyPI
≥ 1.4.0.dev4
< 1.4.0.dev10
1.4.0.dev10

References

Frequently Asked Questions

What is CVE-2026-106440?
CVE-2026-106440 is a security vulnerability in Hydra involving Optuna custom_search_space can resolve and execute untrusted callables via get_method under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection').
Which Hydra versions are affected?
Affected versions include releases prior to 1.3.0, 1.4.0.dev10 across affected packages: hydra-optuna-sweeper.
What version fixes CVE-2026-106440?
Upgrading to 1.3.0, 1.4.0.dev10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hydra-optuna-sweeper affected?
Yes, hydra-optuna-sweeper is affected in releases prior to 1.3.0, 1.4.0.dev10. Upgrade your dependency to 1.3.0, 1.4.0.dev10 or later.
What is the CVSS score of CVE-2026-106440?
CVE-2026-106440 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-106440?
CVE-2026-106440 is classified under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') (The product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.).
How can I check PyPI dependencies for CVE-2026-106440?
Run the dependency tree command: 'pip show hydra-optuna-sweeper'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5jjj-9xc3-rm56",
  "modified" : "2026-10-07T20:24:02Z",
  "published" : "2026-10-07T20:24:02Z",
  "aliases" : [ "CVE-2026-106440" ],
  "summary" : "Hydra: Optuna custom_search_space can resolve and execute untrusted callables via get_method",
  "details" : "## Summary\n\n`hydra-optuna-sweeper` accepted a configuration-controlled dotted path in\n`hydra.sweeper.custom_search_space`, resolved it with the lower-level\n`hydra.utils.get_method()` API, and later invoked the returned callable.\n\nHydra's object-lookup helpers intentionally trust their input and do not apply\nthe execution policy used by `instantiate()` and logging configuration. As a\nresult, untrusted Optuna multirun configuration could select installed Python\ncode for execution in the Hydra controller process.\n\n## Impact\n\nExploitation requires control of an application's Optuna sweep configuration\nor command-line overrides and an importable callable in the application's\nenvironment. Selected code runs with the privileges of the application.\n\nOn affected Hydra 1.4 development releases, this path bypasses an execution\nwhitelist provided by trusted application code. Hydra 1.3 has no execution-whitelist\nsecurity boundary; there, the same change restores the legacy blocklist as\ndefense in depth.\n\n## Fix\n\nThe Optuna sweeper now resolves the configured callback through\n`hydra.utils.instantiate()` as a partial callable. On Hydra 1.4, the active\nexecution whitelist therefore authorizes the callback before use. On Hydra\n1.3, the legacy blocklist is applied as defense in depth.\n\nThe public `get_object()`, `get_method()`, `get_static_method()`, and\n`get_class()` helpers remain lower-level trusted-input APIs. Their documentation\nnow warns against passing values derived from untrusted configuration and\ndirects config-driven construction to `instantiate()`.\n\n## Affected versions\n\n- Package: `hydra-optuna-sweeper`\n- Stable affected range: `>= 1.2.0, < 1.3.0`\n- Stable fixed version: `1.3.0`\n- Development affected range: `>= 1.4.0.dev4, < 1.4.0.dev10`\n- Development fixed version: `1.4.0.dev10`\n\nThe feature was introduced in `1.2.0` and is absent from the 1.1 release line.\nThe 1.4 development line was affected from 1.4.0.dev4 through 1.4.0.dev9.\n\n## Workaround\n\nTreat Optuna sweep configuration and command-line overrides as trusted. Do not\nset `custom_search_space` from externally controlled input or allow untrusted\nusers to place modules on the application import path.\n\nReported by zx (GitHub: @manus-pi).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "hydra-optuna-sweeper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0"
      }, {
        "fixed" : "1.3.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "hydra-optuna-sweeper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.0.dev4"
      }, {
        "fixed" : "1.4.0.dev10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/hydra-ecosystem/hydra/security/advisories/GHSA-5jjj-9xc3-rm56"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-106440"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hydra-ecosystem/hydra/commit/0dd18084589a3d3e577d1f1a8a48fb485c94a5e6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hydra-ecosystem/hydra/commit/4720dfca2bde27fa140ec287a05709668fbdf168"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hydra-ecosystem/hydra"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hydra-ecosystem/hydra/releases/tag/v1.3.7"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-470" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-07T20:24:02Z",
    "nvd_published_at" : "2026-10-06T19:18:12Z"
  }
}