Skip to content

Hydra legacy target blacklist permits unsafe PyYAML loading

High severity GitHub Reviewed Published Oct 27, 2026 to the GitHub Advisory Database • Updated Oct 27, 2026

Package

pip hydra-core (pip)

Affected versions

>= 1.3.6, < 1.3.8
>= 1.4.0.dev9, < 1.4.0rc3

Patched versions

1.3.8
1.4.0rc3

Description

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).

References

Published to the GitHub Advisory Database Oct 27, 2026
Reviewed Oct 27, 2026
Last updated Oct 27, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

EPSS score

Weaknesses

Incomplete List of Disallowed Inputs

The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete. Learn more on MITRE.

CVE ID

No known CVE

GHSA ID

GHSA-wf6j-7hvr-gr93

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.