/

CVE-2026-68508

Severity:

HIGH RISK

(7.8)

Arbitrary Code Execution (CWE-94) in Hydra Instantiate

CVE-2026-68508

Deferred

Vulnerability type

Category:

Arbitrary Code Execution

CWE:

CWE-94, CWE-470

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Hydra's hydra.utils.instantiate() can resolve and call Python objects selected through configuration, including attacker-controlled targets and arguments. When an application passes untrusted configuration, CLI overrides, or model metadata to this function, an attacker may execute arbitrary code within the application's process.

Affected context

The vulnerability occurs in applications, libraries, command-line workflows, or model-loading pipelines that use Hydra's instantiation functionality with configuration data that is not fully trusted. Risk is higher when users, external files, model metadata, automation systems, or other inputs can influence target names or arguments before they are validated and restricted.

Exploit preconditions

  • Attack surface: Hydra configuration processing and calls to hydra.utils.instantiate()
  • Required access: Ability to influence configuration, CLI overrides, model metadata, or another input consumed by the instantiation path
  • Trigger point: Resolution and invocation of a configured target object
  • Why exploitation is possible: Target values and arguments can select callable Python objects without sufficiently restricting which objects may be resolved and executed

Why this happens

The underlying flaw is unsafe dynamic resolution of Python objects from attacker-influenced configuration. Hydra resolves a configured target and invokes it as part of object instantiation, allowing untrusted values to control executable behavior rather than merely representing data. This maps primarily to CWE-94: Improper Control of Generation of Code, with CWE-470: Use of Externally-Controlled Input to Select Classes or Code also describing the unsafe selection pattern.

Potential impact

  • An attacker may execute arbitrary code in the affected process
  • The process could read or modify accessible files and credentials
  • Application data, model artifacts, or configuration could be altered
  • The service or workflow could be terminated or disrupted
  • Compromise could extend to other resources available to the process

General mitigation guidance

Mitigation generally focuses on reducing trust in configuration-driven object resolution and ensuring that only explicitly approved targets can be instantiated.

Common defensive patterns include:

  • Restricting instantiation to a narrowly defined allowlist of safe target types
  • Rejecting arbitrary target paths and dynamically selected callables
  • Separating data-only configuration from executable object construction
  • Validating configuration and metadata against strict schemas before resolution
  • Treating CLI overrides, model metadata, and external files as untrusted input
  • Running affected workflows with least-privilege identities and limited filesystem and credential access
  • Applying security-focused process isolation where dynamic instantiation is unavoidable
  • Using a maintained Hydra release that provides target-blocking controls, while avoiding broad allowlist overrides

How teams detect issues like this

High-level detection can include:

  • Static analysis searches for hydra.utils.instantiate() calls receiving external, deserialized, or user-controlled configuration
  • Code review checks for unrestricted target fields, broad allowlists, and configuration values passed directly into object resolution
  • Dependency and policy scans that identify Hydra versions lacking target-blocking behavior
  • Runtime monitoring for unexpected child processes, file access, credential reads, or process termination during configuration loading
  • CI policies requiring explicit approval for dynamic imports, reflection, or configuration-controlled callable execution
  • Automated code review tools configured to flag externally controlled class or function selection

Sources

SourceLink
github.comgithub.com/hydra-ecosystem/hydra/commit/7faad0dcedfb4c0a364aa1067c0080fd6fdf8dca
github.comgithub.com/hydra-ecosystem/hydra/issues/3259
github.comgithub.com/hydra-ecosystem/hydra/pull/3261
github.comgithub.com/hydra-ecosystem/hydra/releases/tag/v1.3.4
github.comgithub.com/hydra-ecosystem/hydra/security/advisories/GHSA-2cp2-2r3c-7p7r

Frequently asked

questions

It can be exploitable through a remote interface or service when that interface accepts configuration, overrides, or metadata that reaches Hydra instantiation. In other deployments, exploitation may require local access or the ability to modify files and workflow inputs.

The attacker must influence a target value or argument consumed by hydra.utils.instantiate(). The required access depends on whether configuration comes from users, uploaded files, model artifacts, automation, or other external sources.

Use target blocking or an explicit, narrowly scoped allowlist, validate inputs before instantiation, and avoid passing untrusted configuration directly into dynamic object resolution.

Treat configuration and model metadata as data rather than executable instructions, enforce strict schemas and review policies, minimize process privileges, and monitor dynamic loading paths for unexpected behavior.

Find out what's already
exploitable in your codebase.