Skip to content

v2.0

Latest

Choose a tag to compare

@jankoslavic jankoslavic released this 02 Dec 06:50

Security fix

Versions up to 1.26 loaded <filename>.pkl next to a .lvm file with pickle.load on every read(), also with read_from_pickle=False. A .lvm.pkl that came with received data (a zip, a network share, a student submission) could therefore run arbitrary code (CWE-502, #26). Everyone on 1.26 or older should upgrade.

Many thanks to @r3vpwnx (Dilanka Kaushal Hewage) for the responsible report and the clear proof of concept in #26.

Changes

  • The cache now lives in the user's cache directory: ~/.cache/lvm_read on Linux, ~/Library/Caches/lvm_read on macOS, %LOCALAPPDATA%\lvm_read on Windows, or wherever LVM_READ_CACHE_DIR points. Cache files are named by a SHA-256 of the file contents and the package version (#27).
  • A pickle next to the data file is never read. read_from_pickle=False now means that nothing is unpickled.
  • A cache that cannot be written or loaded is skipped; the file is parsed as usual.

Breaking change

Reading a .pkl without its .lvm (read('x.lvm') with only x.lvm.pkl present) no longer works and raises FileNotFoundError. .lvm.pkl files left next to your data by older versions are no longer used and can be deleted.

Full Changelog: v1.26...v2.0