sanketsaurav / lore

Audit required: Use of pickle module BAN-B301
Security
Major
4 years ago5 years old
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
 36        if key in self:
 37            with timer('read %s' % key):
 38                with open(self._path(key), 'rb') as f:
 39                    return pickle.load(f) 40        return None
 41
 42    def __setitem__(self, key, value):
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
 98
 99        if self._datetime_columns is None:
100            with open(self.metadata_path, 'rb') as f:
101                self._datetime_columns = pickle.load(f)102
103        return self._datetime_columns
104
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
333
334        with timer('unpickle model'):
335            with open(model.model_path(), 'rb') as f:
336                loaded = pickle.load(f)337                loaded.fitting = model.fitting
338                return loaded
339