{"id":"GHSA-wf6j-7hvr-gr93","title":"Hydra legacy target blacklist permits unsafe PyYAML loading","summary":"Hydra legacy target blacklist permits unsafe PyYAML loading","severity":"high","cvss":7.8,"cvssVector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","vendor":"hydra-core","product":"hydra-core","ecosystem":"pip","affected":["hydra-core >= 1.3.6, < 1.3.8","hydra-core >= 1.4.0.dev9, < 1.4.0rc3"],"patched":["hydra-core 1.3.8","hydra-core 1.4.0rc3"],"published":"2026-10-27","updated":"2026-10-27","sourceUpdated":"2026-10-27T17:15:04.232998356Z","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-wf6j-7hvr-gr93","references":[{"url":"https://github.com/hydra-ecosystem/hydra/security/advisories/GHSA-757g-8w3h-hp29"},{"url":"https://github.com/hydra-ecosystem/hydra/commit/9a7a9a287d565311183da3392bee4345a7fab6d7"},{"url":"https://github.com/hydra-ecosystem/hydra/commit/de5554320c17cd2d974492c03d0b1456adb4a8ef"},{"url":"https://github.com/hydra-ecosystem/hydra"},{"url":"https://github.com/hydra-ecosystem/hydra/releases/tag/v1.3.8"},{"url":"https://github.com/hydra-ecosystem/hydra/releases/tag/v1.4.0rc3"},{"url":"https://github.com/advisories/GHSA-wf6j-7hvr-gr93"}],"tags":["osv","pip","ghsa"],"cwe":["CWE-184"],"ingestedAt":"2026-10-27T17:33:23.771Z","slug":"GHSA-wf6j-7hvr-gr93","body":"## Overview\n\n## Summary\n\nHydra's legacy target blacklist omits PyYAML's unsafe loading surfaces. If an\napplication passes attacker-controlled targets and arguments to instantiate(),\na target such as yaml.unsafe_load can execute Python code through a\nconfig-controlled YAML stream containing Python object-construction tags.\n\n## Impact and prerequisites\n\nThe attacker must control the relevant target and arguments that the application\ninstantiates. The configured callable executes with the application's process\nprivileges. This is a gap in the best-effort legacy blacklist. It is not a bypass\nof Hydra 1.4's execution whitelist supplied by trusted Python code.\n\nOne realistic exposure is a model downloaded from a third-party repository,\nsuch as Hugging Face, that bundles attacker-controlled configuration. When a\nvictim loads the model using application code that passes this configuration\nto legacy Hydra instantiation without effective target restrictions, the\nmodel's metadata can execute code in the victim process. This model-loading\nattack pattern is documented in the original Hydra advisory\nGHSA-2cp2-2r3c-7p7r and the associated Unit 42 research. It does not imply that\nall Hugging Face models or currently patched downstream loaders are affected.\n\nHydra 1.3's blacklist is defense in depth, not a complete security boundary.\nHydra 1.4 is affected on its deprecated no-whitelist legacy path. Installed\napplication wrappers can perform indirect operations beyond a name-based\nblacklist's coverage; this fix does not make arbitrary configuration safe.\n\nThe unsafe_load finding is directly reproduced. PyYAML 6.0.3 full_load rejects\nthe demonstrated python/object/apply payload, so the finding does not claim that\nall PyYAML loading APIs execute that payload.\n\n## Remediation\n\nThe fix blocks the yaml. target namespace except for the exact yaml.safe_load,\nyaml.safe_load_all, yaml.safe_dump, and yaml.safe_dump_all functions. Loader\nclasses, constructor registration, general dump/load APIs, and other targets in\nthe namespace remain blocked. Existing canonical-identity checks also cover\naliases. The fix preserves Hydra 1.4's explicit unsafe opt-out for trusted use.\n\n## Workarounds\n\nDo not pass untrusted configuration to instantiate() or call(). For Hydra 1.4,\nsupply a narrow execution whitelist from trusted Python code. Do not let\nuntrusted configuration select its own execution policy or opt out of checks.\n\n## Affected releases\n\nThe reported incomplete-remediation stable range is hydra-core 1.3.6 through\n1.3.7. The 1.4 prerelease legacy path is also affected, including 1.4.0.dev9,\n1.4.0.dev10, 1.4.0rc1, and 1.4.0rc2. The related blacklist advisory\nGHSA-rqx7-p7vv-w7hr was first patched in 1.3.6 and 1.4.0.dev9; these ranges\ndescribe the remaining omission after that remediation.\n\n## Credit\n\nReported by zx (@manus-pi).\n\n## Affected packages\n\n- `hydra-core >= 1.3.6, < 1.3.8`\n- `hydra-core >= 1.4.0.dev9, < 1.4.0rc3`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `hydra-core 1.3.8`\n- `hydra-core 1.4.0rc3`","depth":"twilight","depthScore":43,"depthScoreParts":{"impact":42.9,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}