Vulnerabilities in pkg:pypi/hydra-core

PACKAGE
Advisory Identifier: GHSA-mwj6-rfh8-7qf4
Advisory Summary

CVE-2026-106439 is a HIGH mutable instantiate policy sets allow 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 mutable instantiate policy sets allow target blocklist bypass. Remediation is available by upgrading affected packages to version 1.3.7, 1.4.0.dev10.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/hydra-core

4 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-mwj6-rfh8-7qf4 CVE-2026-106439 HIGH Hydra: Mutable instantiate policy sets allow target blocklist bypass
GHSA-c3wx-c55w-pxjq CVE-2026-106441 HIGH Hydra logging configuration permits unsafe callable resolution
GHSA-rqx7-p7vv-w7hr CVE-2026-106442 HIGH Hydra instantiate target blacklist bypasses permit code execution
GHSA-2cp2-2r3c-7p7r CVE-2026-68508 HIGH Hydra: hydra.utils.instantiate with untrusted config can lead to code execution

CVE-2026-106439 at a Glance

CVE Identifier CVE-2026-106439
GHSA Identifier GHSA-mwj6-rfh8-7qf4
Severity HIGH
CVSS v3.1 Base Score N/A
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

How to Fix CVE-2026-106439

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.7
pip install hydra-core>=1.3.7
hydra-core fixed: 1.4.0.dev10
pip install hydra-core>=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-core

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-106439, 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.7), 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's legacy `instantiate()` target blocklists and related execution-policy collections are stored in mutable module-level state. Because `_locate()` can resolve attributes on imported objects, a configuration can resolve a mutation method such as `.discard()`, modify the active policy, and then instantiate a target that would otherwise be blocked. ## Impact A configuration controlling multiple sibling `_target_` entries can first remove an entry from a target blocklist and then invoke the removed target. Sibling nodes are processed in insertion order and consult the same mutable module-level policy. This affects the legacy/default path without an execution whitelist. The 1.3 blocklist is a defense-in-depth measure rather than a complete security boundary, and applications must not treat arbitrary untrusted configuration as safe to instantiate or use for Python logging configuration. Released `hydra-core` versions 1.3.4 through 1.3.6 and 1.4.0.dev4 through 1.4.0.dev9 are affected. Fixed releases are 1.3.7 and 1.4.0.dev10. The reported direct mutation path does not bypass an execution whitelist restricted to intended application targets and supplied by trusted Python code. During remediation, Hydra additionally hardened generic discovery, dispatch, introspection, alias, callable-result, and deferred-callable paths that could otherwise undermine name-only authorization. ## Technical details In `hydra-core` 1.3.4 and 1.3.5, the mutable blocklist is reachable as: `hydra._internal.instantiate._instantiate2.DEFAULT_BLOCKLISTED_MODULES` In `hydra-core` 1.3.6, the expanded policy includes mutable collections in: `hydra._internal.target_policy` For example: `hydra._internal.target_policy.UNCONTROLLED_EXECUTION_TARGETS.discard` resolves to the bound `set.discard` method. The mutation target itself is not blocked on the legacy path. Once an entry is removed, subsequent authorization checks observe the modified set. Other runtime policy collections can be attacked similarly by removing denied entries or adding entries to exception sets. Because the collections are module-level state, a successful mutation persists for the lifetime of the Python process unless explicitly reversed. ## Safe reproduction The behavior in `hydra-core` 1.3.6 can be demonstrated without invoking a shell command. The `finally` block restores the modified process-global state: ```python from omegaconf import OmegaConf from hydra._internal.target_policy import UNCONTROLLED_EXECUTION_TARGETS from hydra.utils import instantiate target = "builtins.eval" assert target in UNCONTROLLED_EXECUTION_TARGETS try: result = instantiate( OmegaConf.create( { "disarm": { "_target_": ( "hydra._internal.target_policy." "UNCONTROLLED_EXECUTION_TARGETS.discard" ), "_args_": [target], }, "proof": { "_target_": target, "_args_": ["40 + 2"], }, } ) ) assert result["proof"] == 42 assert target not in UNCONTROLLED_EXECUTION_TARGETS finally: UNCONTROLLED_EXECUTION_TARGETS.add(target) ``` ## Remediation The fix makes runtime policy state immutable and integrity checked, and prevents declarative configuration from accessing or mutating Hydra internals and protected Python implementation state. Target authorization now covers canonical resolved identities, aliases, discovery results, callable results, deferred callables, and runtime arguments. The patch also rejects configuration-driven code, policy, and process- environment mutation, along with unsafe introspection and formatting traversal that can expose protected runtime capabilities. Hydra 1.3.7 receives these protections as defense in depth; it does not make untrusted configuration sandboxed. Hydra 1.4 additionally uses a trusted, narrowly scoped execution whitelist as the supported security boundary for declarative instantiation and Hydra-controlled Python logging configuration. Users should upgrade to `hydra-core` 1.3.7 on the stable line or 1.4.0.dev10 on the development line. ## Workarounds Do not pass configuration from untrusted sources to `instantiate()` or to Hydra-controlled Python logging configuration. The 1.3 release line has no execution-whitelist facility, so users who cannot upgrade immediately must restrict configuration input to trusted sources. On affected 1.4 development releases, applications can also supply a trusted, narrowly scoped execution whitelist from Python code. The whitelist itself must not be derived from untrusted configuration. Restart any long-running process that may already have instantiated untrusted configuration, because a policy mutation persists in process-global state.

CVE-2026-106439 Affected Hydra Versions

2 component(s)
Fixed Versions:
1.3.71.4.0.dev10
Product / Package Ecosystem Affected Versions Fixed Version
hydra-core
PyPI
≥ 1.3.4
< 1.3.7
1.3.7
hydra-core
PyPI
≥ 1.4.0.dev4
< 1.4.0.dev10
1.4.0.dev10

References

Frequently Asked Questions

What is CVE-2026-106439?
CVE-2026-106439 is a security vulnerability in Hydra involving Mutable instantiate policy sets allow target blocklist bypass 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.7, 1.4.0.dev10 across affected packages: hydra-core.
What version fixes CVE-2026-106439?
Upgrading to 1.3.7, 1.4.0.dev10 (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.7, 1.4.0.dev10. Upgrade your dependency to 1.3.7, 1.4.0.dev10 or later.
What CWE is associated with CVE-2026-106439?
CVE-2026-106439 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-106439?
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-mwj6-rfh8-7qf4",
  "modified" : "2026-10-07T20:23:58Z",
  "published" : "2026-10-07T20:23:57Z",
  "aliases" : [ "CVE-2026-106439" ],
  "summary" : "Hydra: Mutable instantiate policy sets allow target blocklist bypass",
  "details" : "## Summary\n\nHydra's legacy `instantiate()` target blocklists and related execution-policy\ncollections are stored in mutable module-level state. Because `_locate()` can\nresolve attributes on imported objects, a configuration can resolve a mutation\nmethod such as `.discard()`, modify the active policy, and then instantiate a\ntarget that would otherwise be blocked.\n\n## Impact\n\nA configuration controlling multiple sibling `_target_` entries can first\nremove an entry from a target blocklist and then invoke the removed target.\nSibling nodes are processed in insertion order and consult the same mutable\nmodule-level policy.\n\nThis affects the legacy/default path without an execution whitelist. The 1.3\nblocklist is a defense-in-depth measure rather than a complete security\nboundary, and applications must not treat arbitrary untrusted configuration as\nsafe to instantiate or use for Python logging configuration.\n\nReleased `hydra-core` versions 1.3.4 through 1.3.6 and 1.4.0.dev4 through\n1.4.0.dev9 are affected. Fixed releases are 1.3.7 and 1.4.0.dev10.\nThe reported direct mutation path does not bypass an execution whitelist\nrestricted to intended application targets and supplied by trusted Python\ncode. During remediation, Hydra additionally hardened generic discovery,\ndispatch, introspection, alias, callable-result, and deferred-callable paths\nthat could otherwise undermine name-only authorization.\n\n## Technical details\n\nIn `hydra-core` 1.3.4 and 1.3.5, the mutable blocklist is reachable as:\n\n`hydra._internal.instantiate._instantiate2.DEFAULT_BLOCKLISTED_MODULES`\n\nIn `hydra-core` 1.3.6, the expanded policy includes mutable collections in:\n\n`hydra._internal.target_policy`\n\nFor example:\n\n`hydra._internal.target_policy.UNCONTROLLED_EXECUTION_TARGETS.discard`\n\nresolves to the bound `set.discard` method. The mutation target itself is not\nblocked on the legacy path. Once an entry is removed, subsequent authorization\nchecks observe the modified set.\n\nOther runtime policy collections can be attacked similarly by removing denied\nentries or adding entries to exception sets. Because the collections are\nmodule-level state, a successful mutation persists for the lifetime of the\nPython process unless explicitly reversed.\n\n## Safe reproduction\n\nThe behavior in `hydra-core` 1.3.6 can be demonstrated without invoking a shell\ncommand. The `finally` block restores the modified process-global state:\n\n```python\nfrom omegaconf import OmegaConf\n\nfrom hydra._internal.target_policy import UNCONTROLLED_EXECUTION_TARGETS\nfrom hydra.utils import instantiate\n\ntarget = \"builtins.eval\"\nassert target in UNCONTROLLED_EXECUTION_TARGETS\n\ntry:\n    result = instantiate(\n        OmegaConf.create(\n            {\n                \"disarm\": {\n                    \"_target_\": (\n                        \"hydra._internal.target_policy.\"\n                        \"UNCONTROLLED_EXECUTION_TARGETS.discard\"\n                    ),\n                    \"_args_\": [target],\n                },\n                \"proof\": {\n                    \"_target_\": target,\n                    \"_args_\": [\"40 + 2\"],\n                },\n            }\n        )\n    )\n\n    assert result[\"proof\"] == 42\n    assert target not in UNCONTROLLED_EXECUTION_TARGETS\nfinally:\n    UNCONTROLLED_EXECUTION_TARGETS.add(target)\n```\n\n## Remediation\n\nThe fix makes runtime policy state immutable and integrity checked, and\nprevents declarative configuration from accessing or mutating Hydra internals\nand protected Python implementation state. Target authorization now covers\ncanonical resolved identities, aliases, discovery results, callable results,\ndeferred callables, and runtime arguments.\n\nThe patch also rejects configuration-driven code, policy, and process-\nenvironment mutation, along with unsafe introspection and formatting traversal\nthat can expose protected runtime capabilities.\n\nHydra 1.3.7 receives these protections as defense in depth; it does not make\nuntrusted configuration sandboxed. Hydra 1.4 additionally uses a trusted,\nnarrowly scoped execution whitelist as the supported security boundary for\ndeclarative instantiation and Hydra-controlled Python logging configuration.\n\nUsers should upgrade to `hydra-core` 1.3.7 on the stable line or\n1.4.0.dev10 on the development line.\n\n## Workarounds\n\nDo not pass configuration from untrusted sources to `instantiate()` or to\nHydra-controlled Python logging configuration. The 1.3 release line has no\nexecution-whitelist facility, so users who cannot upgrade immediately must\nrestrict configuration input to trusted sources.\n\nOn affected 1.4 development releases, applications can also supply a trusted,\nnarrowly scoped execution whitelist from Python code. The whitelist itself must\nnot be derived from untrusted configuration.\n\nRestart any long-running process that may already have instantiated untrusted\nconfiguration, because a policy mutation persists in process-global state.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "hydra-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.3.4"
      }, {
        "fixed" : "1.3.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "hydra-core"
    },
    "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-mwj6-rfh8-7qf4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-106439"
  }, {
    "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", "CWE-693" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-07T20:23:57Z",
    "nvd_published_at" : "2026-10-06T19:18:12Z"
  }
}