### 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.ro