Repository navigation
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_readon Linux,~/Library/Caches/lvm_readon macOS,%LOCALAPPDATA%\lvm_readon Windows, or whereverLVM_READ_CACHE_DIRpoints. 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=Falsenow 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