Incomplete blacklist in Hydra lets PyYAML unsafe_load run code
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
hydra-core from 1.3.6 before 1.3.8 and from 1.4.0.dev9 before 1.4.0rc3 (PyPI) has an incomplete legacy target blacklist (CWE-184) that omits PyYAML unsafe loading functions. An attacker who controls the targets and arguments an application passes to instantiate() can run Python code through a YAML stream with object-construction tags. The configured callable runs with the application's process privileges.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
Description from the GitHub advisory
## 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).
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | hydra-core (PyPI) | 1.3.6 to before 1.3.8 | 1.3.8 | Patch available | GHSA-wf6j-7hvr-gr93 |
| — | hydra-core (PyPI) | 1.4.0.dev9 to before 1.4.0rc3 | 1.4.0rc3 | Patch available | GHSA-wf6j-7hvr-gr93 |
- hydra-core (PyPI) Vendor— Affected 1.3.6 to before 1.3.8 Fixed in 1.3.8 Patch available GHSA-wf6j-7hvr-gr93
- hydra-core (PyPI) Vendor— Affected 1.4.0.dev9 to before 1.4.0rc3 Fixed in 1.4.0rc3 Patch available GHSA-wf6j-7hvr-gr93
Remediation
Upgrade hydra-core 1.3 releases to 1.3.8 and 1.4 prereleases to 1.4.0rc3. Until then, do not pass untrusted configuration to instantiate() or call().
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
- Fix · GHSA-wf6j-7hvr-gr93 hydra-core (PyPI) Fixed in 1.3.8 Advisory →
- Fix · GHSA-wf6j-7hvr-gr93 hydra-core (PyPI) Fixed in 1.4.0rc3 Advisory →
Timeline
- 2026-10-27 Threatist record created from GHSA-wf6j-7hvr-gr93
References
Other 6
- https://github.com/hydra-ecosystem/hydra/security/advisories/GHSA-757g-8w3h-hp29
- https://github.com/hydra-ecosystem/hydra/commit/9a7a9a287d565311183da3392bee4345a7fab6d7
- https://github.com/hydra-ecosystem/hydra/commit/de5554320c17cd2d974492c03d0b1456adb4a8ef
- https://github.com/hydra-ecosystem/hydra
- https://github.com/hydra-ecosystem/hydra/releases/tag/v1.3.8
- https://github.com/hydra-ecosystem/hydra/releases/tag/v1.4.0rc3
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences