CVE-2026-68508: Hydra Hydra.utils.instantiate With Untrusted Config Can Vulnerability

HIGH
Advisory Identifier: GHSA-2cp2-2r3c-7p7r
CVSS 7.8
CWE-470 CWE-94
Published
Advisory Summary

CVE-2026-68508 is a HIGH (CVSS 7.8) hydra.utils.instantiate with untrusted config can 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 hydra.utils.instantiate with untrusted config can lead to code execution. Remediation is available by upgrading affected packages to version 1.3.4.

CVE-2026-68508 at a Glance

CVE Identifier CVE-2026-68508
GHSA Identifier GHSA-2cp2-2r3c-7p7r
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-68508

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-core fixed: 1.3.4
pip install hydra-core>=1.3.4
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-core

How to Check if You Are Affected

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

pip show hydra-core

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.4), your application is affected.

Note: The pip show hydra-core 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.utils.instantiate()` resolves and calls Python objects from config. If an application passes untrusted config to `instantiate()`, an attacker who controls `_target_` and its arguments can cause arbitrary code execution in the consuming process. Hydra is not a network service. Exploitation requires a consuming application, library, or user workflow to load attacker-controlled config, CLI overrides, or model metadata and pass it to `hydra.utils.instantiate()`. ## Details Hydra's instantiate API is designed to construct objects and call functions from configuration. For example: ```yaml component: _target_: package.module.Class arg: value ``` When this config is passed to `hydra.utils.instantiate()`, Hydra resolves `_target_` and calls it with the provided arguments. This is intended for trusted application configuration. However, if untrusted input controls `_target_`, the config becomes a callable-selection mechanism. A malicious config can select a callable capable of executing code or commands and provide attacker-controlled arguments. This issue is the same general class of problem discussed by Unit 42 for downstream AI/ML libraries such as NVIDIA NeMo, where untrusted model metadata was passed into Hydra instantiate: https://unit42.paloaltonetworks.com/rce-vulnerabilities-in-ai-python-libraries/ Hydra 1.3.4 includes a blacklist for some dangerous `_target_` values. That blacklist is defense-in-depth and is not a complete security boundary. The blacklist is not present in the released `hydra-core` 1.3.3 package, so this issue should not be described as a bypass of a released 1.3.3 blacklist. ## Impact A successful attack can execute code in the process that calls `hydra.utils.instantiate()`. The impact is limited to the privileges and environment of that process. Potential impact includes: - Reading files, credentials, environment variables, or data accessible to the process - Modifying files, outputs, checkpoints, or application state writable by the process - Terminating or disrupting the process ## Affected Usage Applications and libraries are affected when they pass untrusted or semi-trusted config, model metadata, CLI overrides, or other externally controlled data to `hydra.utils.instantiate()` without constraining which targets may be instantiated. Trusted application-owned configuration is not affected in the same way. ## Remediation Hydra 1.3.4 hardens the existing behavior by adding a blacklist of obvious dangerous targets. It is a substantial security improvement, and users remaining on the 1.3 release line should upgrade to 1.3.4 or a newer version. The unreleased Hydra 1.4 development line uses an allowlist-based instantiation model that fully addresses this vulnerability class. The allowlist must come from trusted application code or another trusted channel, not from the untrusted config being instantiated. Applications that consume untrusted or semi-trusted config should not pass it directly to `hydra.utils.instantiate()`. They should validate `_target_` values against a trusted allowlist before instantiation.

CVE-2026-68508 Affected Hydra Versions

1 component(s)
Fixed Versions:
1.3.4
Product / Package Ecosystem Affected Versions Fixed Version
hydra-core
PyPI
< 1.3.4
1.3.4

References

Frequently Asked Questions

What is CVE-2026-68508?
CVE-2026-68508 is a security vulnerability in Hydra involving hydra.utils.instantiate with untrusted config can lead to code execution 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.4 across affected packages: hydra-core.
What version fixes CVE-2026-68508?
Upgrading to 1.3.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hydra-core affected?
Yes, hydra-core is affected in releases prior to 1.3.4. Upgrade your dependency to 1.3.4 or later.
What is the CVSS score of CVE-2026-68508?
CVE-2026-68508 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-68508?
CVE-2026-68508 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-68508?
Run the dependency tree command: 'pip show hydra-core'. 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-2cp2-2r3c-7p7r",
  "modified" : "2026-08-21T20:57:31Z",
  "published" : "2026-08-21T20:57:31Z",
  "aliases" : [ "CVE-2026-68508" ],
  "summary" : "Hydra: hydra.utils.instantiate with untrusted config can lead to code execution",
  "details" : "## Summary\n\n`hydra.utils.instantiate()` resolves and calls Python objects from config. If an\napplication passes untrusted config to `instantiate()`, an attacker who controls\n`_target_` and its arguments can cause arbitrary code execution in the consuming\nprocess.\n\nHydra is not a network service. Exploitation requires a consuming application,\nlibrary, or user workflow to load attacker-controlled config, CLI overrides, or\nmodel metadata and pass it to `hydra.utils.instantiate()`.\n\n## Details\n\nHydra's instantiate API is designed to construct objects and call functions from\nconfiguration. For example:\n\n```yaml\ncomponent:\n  _target_: package.module.Class\n  arg: value\n```\n\nWhen this config is passed to `hydra.utils.instantiate()`, Hydra resolves\n`_target_` and calls it with the provided arguments.\n\nThis is intended for trusted application configuration. However, if untrusted\ninput controls `_target_`, the config becomes a callable-selection mechanism. A\nmalicious config can select a callable capable of executing code or commands and\nprovide attacker-controlled arguments.\n\nThis issue is the same general class of problem discussed by Unit 42 for\ndownstream AI/ML libraries such as NVIDIA NeMo, where untrusted model metadata\nwas passed into Hydra instantiate:\n\nhttps://unit42.paloaltonetworks.com/rce-vulnerabilities-in-ai-python-libraries/\n\nHydra 1.3.4 includes a blacklist for some dangerous `_target_` values. That\nblacklist is defense-in-depth and is not a complete security boundary. The\nblacklist is not present in the released `hydra-core` 1.3.3 package, so this\nissue should not be described as a bypass of a released 1.3.3 blacklist.\n\n## Impact\n\nA successful attack can execute code in the process that calls\n`hydra.utils.instantiate()`. The impact is limited to the privileges and\nenvironment of that process.\n\nPotential impact includes:\n\n- Reading files, credentials, environment variables, or data accessible to the\n  process\n- Modifying files, outputs, checkpoints, or application state writable by the\n  process\n- Terminating or disrupting the process\n\n## Affected Usage\n\nApplications and libraries are affected when they pass untrusted or semi-trusted\nconfig, model metadata, CLI overrides, or other externally controlled data to\n`hydra.utils.instantiate()` without constraining which targets may be\ninstantiated.\n\nTrusted application-owned configuration is not affected in the same way.\n\n## Remediation\n\nHydra 1.3.4 hardens the existing behavior by adding a blacklist of obvious\ndangerous targets. It is a substantial security improvement, and users remaining\non the 1.3 release line should upgrade to 1.3.4 or a newer version.\n\nThe unreleased Hydra 1.4 development line uses an allowlist-based instantiation\nmodel that fully addresses this vulnerability class. The allowlist must come\nfrom trusted application code or another trusted channel, not from the untrusted\nconfig being instantiated.\n\nApplications that consume untrusted or semi-trusted config should not pass it\ndirectly to `hydra.utils.instantiate()`. They should validate `_target_` values\nagainst a trusted allowlist before instantiation.",
  "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-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.3.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/hydra-ecosystem/hydra/security/advisories/GHSA-2cp2-2r3c-7p7r"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hydra-ecosystem/hydra/issues/3259"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hydra-ecosystem/hydra/pull/3261"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hydra-ecosystem/hydra/commit/7faad0dcedfb4c0a364aa1067c0080fd6fdf8dca"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hydra-ecosystem/hydra"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hydra-ecosystem/hydra/releases/tag/v1.3.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-470", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-21T20:57:31Z",
    "nvd_published_at" : null
  }
}