Skip to content
HighVulnerability

GHSA-wf6j-7hvr-gr93: Hydra legacy target blacklist permits unsafe PyYAML loading

Published
Record updated
View JSON
Affected
  • hydra-core >= 1.4.0.dev9, < 1.4.0rc3, fixed in 1.4.0rc3
  • hydra-core >= 1.3.6, < 1.3.8, fixed in 1.3.8

Summary

Hydra's legacy target blacklist omits PyYAML's unsafe loading functions, so an application that passes attacker-controlled targets and arguments to instantiate() can let yaml.unsafe_load run Python code from a config-controlled YAML stream. The attacker must control the target and arguments, and the callable runs with the application's process privileges; the affected ranges are hydra-core 1.3.6 through 1.3.7 and the 1.4 prerelease legacy path (1.4.0.dev9, 1.4.0.dev10, 1.4.0rc1, 1.4.0rc2).

Mitigation

The fix blocks the yaml. target namespace except for yaml.safe_load, yaml.safe_load_all, yaml.safe_dump, and yaml.safe_dump_all. Workarounds: do not pass untrusted configuration to instantiate() or call(), and for Hydra 1.4 supply a narrow execution whitelist from trusted Python code.