/

CVE-2026-132751

Severity:

HIGH RISK

(7.8)

Code Injection (CWE-95) in yt HDF5 Dataset Loader Parser

CVE-2026-132751

Received

Vulnerability type

Category:

Code Injection

CWE:

CWE-95

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

yt evaluates the con_args attribute from ytdata HDF5 files as Python code when loading a saved dataset. A malicious file may therefore execute code with the permissions of the user who loads it.

Affected context

The vulnerability occurs in SavedDataset._parse_parameter_file() when yt processes the con_args attribute in a ytdata HDF5 file. It becomes risky when a user loads a crafted .h5 file with yt.load() and the attribute reaches unrestricted evaluation.

Exploit preconditions

  • Attack surface: Loading a ytdata HDF5 file through yt.
  • Required access: An attacker must be able to provide or influence a file that a user will load; the attacker does not necessarily need direct access to the user's runtime.
  • Trigger point: Processing con_args in SavedDataset._parse_parameter_file() during dataset loading.
  • Why exploitation is possible: The attribute is passed to unrestricted eval(), allowing its contents to be interpreted as Python code.

Why this happens

The code evaluates a value from a dataset file rather than treating it strictly as data. Using unrestricted eval() on attacker-influenced input can execute Python expressions, matching CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code.

Potential impact

  • An attacker could execute Python code with the loading user's permissions.
  • The user's files, credentials, or accessible data may be exposed or modified.
  • The compromised process could be used to affect other systems or services available to that user.

General mitigation guidance

Mitigation generally focuses on removing dynamic evaluation of file-controlled values and reducing trust in dataset metadata.

Common defensive patterns include:

  • Parse values with data-only formats or restricted parsers instead of evaluating them as code.
  • If expressions are required, define and enforce a narrow, explicit grammar and reject unsupported constructs.
  • Treat datasets from external or untrusted sources as potentially hostile, and validate their metadata before use.
  • Load untrusted files in isolated environments with minimal permissions and limited access to sensitive resources.

How teams detect issues like this

  • Use static analysis to identify eval() and similar dynamic execution APIs, especially when their inputs originate from files or metadata.
  • Review dataset-loading paths for flows from HDF5 attributes into interpreters or expression evaluators.
  • Apply code-review policies that require justification and strict input constraints for dynamic evaluation.
  • Use automated code review or security scanning tools to flag risky evaluation patterns.

Sources

SourceLink
github.comgithub.com/yt-project/yt/blob/yt-4.4.4/yt/frontends/ytdata/data_structures.py#L52-L56
github.comgithub.com/yt-project/yt/commit/ce997aebb89423a6f5d86c3bda24094e908d3c2d
github.comgithub.com/yt-project/yt/issues/5641
vulncheck.comvulncheck.com/advisories/yt-through-4.4.4-code-injection-via-con-args-eval-in-ytdata-hdf5

Frequently asked

questions

The issue is triggered when a crafted dataset file is loaded. An attacker may reach a victim by supplying a file for them to load, but the description does not indicate that merely connecting to a network service triggers it.

The attacker needs a way to provide or influence a ytdata HDF5 file that a user loads with yt.load().

Avoid evaluating file-provided values as Python code. Use data-only parsing or a narrowly constrained representation instead.

Treat files and their metadata as untrusted, validate inputs against explicit schemas, scan for dynamic evaluation of externally influenced values, and limit the privileges of processes that handle untrusted files.

Find out what's already
exploitable in your codebase.