Audit required: Use of pickle module BAN-B301
Security
Major
4 days ago2 years old
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
361        self.log_count = 0
362        try:
363            with open(self.datfilename, 'rb') as datfile:
364                self.history_dict = pickle.load(datfile)365        except (OSError, EOFError):
366            # no saved history exists yet, or history dump broken
367            self.history_dict = {}
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
133    def _load_cache(self):
134        """Load the cache entry."""
135        with self._cachefile_path().open('rb') as f:
136            self.key, self._data, self._cachetime = pickle.load(f)137        return True
138
139    def parse_key(self):
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
299        self.datafile = pywikibot.config.datafilepath(
300            f'{self.site.dbName()}-catmovebot-data')
301        with suppress(OSError), open(self.datafile, 'rb') as inp:
302            self.record = pickle.load(inp)303        if self.record:
304            with open(self.datafile + '.bak', 'wb') as f:
305                pickle.dump(self.record, f, protocol=config.pickle_protocol)
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
 355                    pywikibot.info('Reading dump from '
 356                                   + config.shortpath(self.filename))
 357                with open_archive(self.filename, 'rb') as f:
 358                    databases = pickle.load(f) 359                # keys are categories, values are 2-tuples with lists as
 360                # entries.
 361                self.cat_content_db = databases['cat_content_db']
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
1244        try:
1245            filename = self._cachefile_path()
1246            with filename.open('rb') as f:
1247                uniquedescr, self._data, self._cachetime = pickle.load(f)1248
1249            if uniquedescr != self._uniquedescriptionstr():
1250                raise RuntimeError('Expected unique description for the cache '