GHSA-2cp2-2r3c-7p7r: Code Injection

Published Aug 21, 2026
·
Updated

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.

Affected Software

1 affected componentFixes available
pip/hydra-core<=1.3.3
1.3.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/hydra-core to a version that resolves this vulnerability.

    Fixed in 1.3.4
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 1.3.4
  3. Configuration

    Constrain what can be instantiated by validating `_target_` values before calling `hydra.utils.instantiate()`. The material notes Hydra 1.4 uses allowlist-based instantiation, while Hydra 1.3.4 adds a blacklist of dangerous `_target_` values as defense-in-depth.

    Hydra _target_ (instantiation target) = Use only trusted allowlisted `_target_` values; do not allow arbitrary/externally supplied `_target_` strings
  4. Compensating control

    Ensure `_target_` values passed to `hydra.utils.instantiate()` come only from trusted application configuration (do not pass attacker-controlled config, CLI overrides, model metadata, or other externally controlled data into `instantiate()`).

Event History

Aug 21, 2026
Advisory Published
via GitHub·08:57 PM
Data Sourced
via GitHub·08:57 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are realistically exposed?

Hydra itself is not a network service. Exposure is limited to applications, libraries, or workflows that accept attacker-controlled configuration, CLI overrides, or model metadata and pass that data to hydra.utils.instantiate().

2

What must an attacker control to achieve code execution?

The attacker needs control over the instantiated configuration's _target_ value and its arguments. Hydra resolves that target and calls the selected Python object in the consuming process.

3

What can be done if updating is not immediately possible?

Do not pass untrusted configuration, overrides, or model metadata to hydra.utils.instantiate(). Treat any input that can control _target_ or its arguments as trusted-only.

4

How can I determine whether an application is affected?

Identify calls to hydra.utils.instantiate() and trace whether their configuration can originate from external users, uploaded or downloaded metadata, command-line overrides, or other untrusted sources. Applications that instantiate only trusted, application-controlled configuration are not described as exposed.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203