VAITP Dataset

← Back to the dataset

CVE-2026-132751

Code injection via crafted con_args in yt HDF5 files, execs Python on load.

  • CVSS 8.5
  • CWE-95
  • Input Validation and Sanitization
  • Local

yt through 4.4.4 contains a code injection vulnerability that allows attackers to execute Python code by supplying a crafted con_args attribute in a ytdata HDF5 file. SavedDataset._parse_parameter_file() passes con_args to eval() unrestricted, so loading a malicious .h5 file with yt.load() runs attacker code as the user.

CVSS base score
8.5
Published
2026-11-19
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Local
Impact
Arbitrary Code Execution
Affected component
yt
Fixed by upgrading
Yes

Solution

Upgrade yt to version 4.4.5 or later, where the con_args handling in SavedDataset._parse_parameter_file() is sanitized and the unsafe eval() call is removed.

Vulnerable code sample

import yt
import h5py

class SavedDataset:
    def __init__(self, filename):
        self.filename = filename
        self.parameters = {}
        self._parse_parameter_file()

    def _parse_parameter_file(self):
        with h5py.File(self.filename, 'r') as f:
            # VULNERABLE: eval of untrusted con_args
            con_args = eval(f['/parameter_file'].attrs['con_args'])
            self.parameters.update(con_args)

    def load(self):
        return yt.load(self.filename, **self.parameters)

Patched code sample

import yt
import h5py
import ast

class SavedDataset:
    def __init__(self, filename):
        self.filename = filename
        self.parameters = {}
        self._parse_parameter_file()

    def _parse_parameter_file(self):
        with h5py.File(self.filename, 'r') as f:
            # FIX: use safe literal evaluation
            con_args = ast.literal_eval(f['/parameter_file'].attrs['con_args'])
            self.parameters.update(con_args)

    def load(self):
        return yt.load(self.filename, **self.parameters)

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • Fix #5641 (yt-project/yt)
    yt/frontends/ytdata/data_structures.py, yt/frontends/ytdata/data_structures.py · SavedDataset._parse_parameter_file

Cite this entry

@misc{vaitp:cve2026132751,
  title        = {{Code injection via crafted con_args in yt HDF5 files, execs Python on load.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-132751},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-132751/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.