ThinkFacility Sign in
  1. Home
  2. Security
  3. Python package (tables)
CriticalPython package (tables)

PyTables 3.11.1 and earlier: opening a malicious HDF5 file can run code, no fix yet

Python users who open HDF5 files they didn't make, with PyTables or pandas.read_hdf, in notebooks, data pipelines or ML services.

How to fix it

You haveUpdate to
<= 3.11.1→No fixed version listed

Check your version

Which version you have
pip show tables

If you can't update yet

Don't open untrusted .h5 files. On 3.12, open them with tables.open_file(path, allow_pickle=False), or set tables.parameters.ALLOW_PICKLE = False for every file. Through pandas, pass allow_pickle=False to read_hdf or HDFStore.

Opening a malicious .h5 file and reading one metadata attribute runs the attacker's code, because PyTables unpickles some attributes on its own. pandas.read_hdf() builds on PyTables, so it's exposed too. Version 3.12 adds an opt-out but still unpickles by default, and the maintainers expect to switch that off in 3.13.

Sources