GHSA-wf6j-7hvr-gr93: Hydra legacy target blacklist permits unsafe PyYAML loading
Hydra's legacy target blacklist does not cover PyYAML's unsafe loaders. If an application passes attacker-controlled targets and arguments to `instantiate()`, a target like `yaml.unsafe_load` can run Python code from a YAML stream. Affected: hydra-core 1.3.6 to 1.3.7 and 1.4.0.dev9 to 1.4.0rc2. Fixed in 1.3.8 and 1.4.0rc3.
Published Oct 27, 2026 · Analysis Nov 1, 2026
What an attacker can do
Hydra's instantiate() builds objects from a config that names a target callable and its arguments. To limit abuse, the legacy path rejects a list of dangerous targets. That list left out the yaml namespace. An attacker who controls the target and arguments can set the target to yaml.unsafe_load and pass a YAML stream with Python object-construction tags such as python/object/apply. The callable runs with the application's privileges, which means arbitrary code execution (CWE-184).
The advisory is careful about scope. The attacker must control the target and arguments the application instantiates. It is a gap in a best-effort blacklist, not a bypass of the execution whitelist in Hydra 1.4 supplied by trusted code. The unsafe_load case was reproduced directly. PyYAML 6.0.3 full_load rejects the demonstrated payload, so not every PyYAML loader is exploitable.
The realistic exposure is a model from a third-party repository that bundles a config. If your loader hands that config to legacy Hydra instantiation without target restrictions, loading the model runs the attacker's code in your process. The advisory says this does not mean all hosted models or patched loaders are affected. The vector shows local attack vector with user interaction.
Who is affected
Affected hydra-core ranges: 1.3.6 up to but not including 1.3.8, and 1.4.0.dev9 up to but not including 1.4.0rc3. The 1.4 prerelease issue is on its deprecated legacy path with no whitelist. Applications that pass only trusted configuration to instantiate() or call() are not exposed.
pip show hydra-coreSearch your code for instantiate( and call( and see where the config comes from.
hydra-core
- Ecosystem
- PyPI
- Affected
- >= 1.3.6, < 1.3.8
- Fixed in
- 1.3.8
- Check
pip show hydra-core
hydra-core
- Ecosystem
- PyPI
- Affected
- >= 1.4.0.dev9, < 1.4.0rc3
- Fixed in
- 1.4.0rc3
- Check
pip show hydra-core
How to fix it
Upgrade to hydra-core 1.3.8, or 1.4.0rc3 if you are on the 1.4 line:
pip install --upgrade "hydra-core>=1.3.8"The fix blocks the yaml. target namespace, except the exact functions yaml.safe_load, yaml.safe_load_all, yaml.safe_dump and yaml.safe_dump_all. Loader classes, constructor registration and general load or dump APIs stay blocked. Alias checks also cover renamed imports. Hydra 1.4's explicit unsafe opt-out for trusted use is kept.
Workarounds from the advisory: do not pass untrusted configuration to instantiate() or call(). On Hydra 1.4, supply a narrow execution whitelist from trusted Python code, and never let untrusted config pick its own policy or opt out of checks. The advisory says the fix does not make arbitrary configuration safe.
How to tell if you were hit
Review configs loaded by your applications, especially ones shipped with downloaded models, for _target_ values starting with yaml. such as yaml.unsafe_load, or YAML text containing !!python/object/apply. Search model repositories you pull from for such strings.
At runtime, look for unexpected child processes, network calls or file writes from the process that loads models. Check which Hydra version each environment resolves with pip show hydra-core.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Hydra's legacy target blacklist omits PyYAML's unsafe loading surfaces. If an application passes attacker-controlled targets and arguments to instantiate(), a target such as yaml.unsafe_load can execute Python code through a config-controlled YAML stream containing Python object-construction tags.
Impact and prerequisites
The attacker must control the relevant target and arguments that the application instantiates. The configured callable executes with the application's process privileges. This is a gap in the best-effort legacy blacklist. It is not a bypass of Hydra 1.4's execution whitelist supplied by trusted Python code.
One realistic exposure is a model downloaded from a third-party repository, such as Hugging Face, that bundles attacker-controlled configuration. When a victim loads the model using application code that passes this configuration to legacy Hydra instantiation without effective target restrictions, the model's metadata can execute code in the victim process. This model-loading attack pattern is documented in the original Hydra advisory GHSA-2cp2-2r3c-7p7r and the associated Unit 42 research. It does not imply that all Hugging Face models or currently patched downstream loaders are affected.
Hydra 1.3's blacklist is defense in depth, not a complete security boundary. Hydra 1.4 is affected on its deprecated no-whitelist legacy path. Installed application wrappers can perform indirect operations beyond a name-based blacklist's coverage; this fix does not make arbitrary configuration safe.
The unsafe_load finding is directly reproduced. PyYAML 6.0.3 full_load rejects the demonstrated python/object/apply payload, so the finding does not claim that all PyYAML loading APIs execute that payload.
Remediation
The fix blocks the yaml. target namespace except for the exact yaml.safe_load, yaml.safe_load_all, yaml.safe_dump, and yaml.safe_dump_all functions. Loader classes, constructor registration, general dump/load APIs, and other targets in the namespace remain blocked. Existing canonical-identity checks also cover aliases. The fix preserves Hydra 1.4's explicit unsafe opt-out for trusted use.
Workarounds
Do not pass untrusted configuration to instantiate() or call(). For Hydra 1.4, supply a narrow execution whitelist from trusted Python code. Do not let untrusted configuration select its own execution policy or opt out of checks.
Affected releases
The reported incomplete-remediation stable range is hydra-core 1.3.6 through 1.3.7. The 1.4 prerelease legacy path is also affected, including 1.4.0.dev9, 1.4.0.dev10, 1.4.0rc1, and 1.4.0rc2. The related blacklist advisory GHSA-rqx7-p7vv-w7hr was first patched in 1.3.6 and 1.4.0.dev9; these ranges describe the remaining omission after that remediation.
Credit
Reported by zx (@manus-pi).
Questions
- Which hydra-core versions fix this?
1.3.8 for the 1.3 line and 1.4.0rc3 for the 1.4 prerelease line. The affected ranges are 1.3.6 to 1.3.7 and 1.4.0.dev9 to 1.4.0rc2.
- Is every Hugging Face model dangerous?
No. The advisory says it does not imply all hosted models or patched downstream loaders are affected. The risk exists when your loader passes a model's bundled config to legacy Hydra instantiation without target restrictions.
- Does this bypass the Hydra 1.4 whitelist?
No. The advisory says it is not a bypass of the 1.4 execution whitelist supplied by trusted Python code. It affects the deprecated legacy path without a whitelist.
- Is it exploited in the wild?
No source reports exploitation, and it is not in CISA's KEV catalog. The advisory says the
unsafe_loadcase was reproduced directly.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-106439
Hydra: Mutable instantiate policy sets allow target blocklist bypass
high8.5Oct 7, 2026CVE-2026-106441
Hydra logging configuration permits unsafe callable resolution
high7.8Oct 7, 2026CVE-2026-106442
Hydra instantiate target blacklist bypasses permit code execution
high7.8Oct 7, 2026CVE-2026-68508
Hydra: hydra.utils.instantiate with untrusted config can lead to code execution
high7.8Aug 21, 2026
