Disable cache backend using pickle#1
Open
soapy1 wants to merge 4 commits into
Open
Conversation
- create cache dirs only accessible by owner - set default cache to JSONCache refs: - grantjenks#359 - src.fedoraproject.org/rpms/python-diskcache/pull-request/1#
soapy1
commented
Apr 24, 2026
| :param int pickle_protocol: pickle protocol for serialization | ||
|
|
||
| """ | ||
| raise RuntimeError("Disk has been disabled as a mitigation for CVE-2025-69872. Please use JSONDisk instead.") |
Owner
Author
There was a problem hiding this comment.
Also considered raising other errors - TypeError, NotImplementedError but these seemed not as accurate.
soapy1
commented
Apr 24, 2026
| """ | ||
| self.compress_level = compress_level | ||
| super().__init__(directory, **kwargs) | ||
| self._directory = directory |
Owner
Author
There was a problem hiding this comment.
This still keeps the relationship between JSONDisk and Disk but tries to avoid raising the error when Disk is instantiated.
It might be worth it to try to separate these two a bit more.
soapy1
commented
Apr 24, 2026
| EVICTION_POLICY, | ||
| UNKNOWN, | ||
| Cache, | ||
| Disk, |
Owner
Author
There was a problem hiding this comment.
This makes diskcache.Disk not importable. For example:
$ python
>>> import diskcache
>>> from diskcache import JSONDisk
>>> from diskcache import Disk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Disk' from 'diskcache' (/home/sophia/projects/python-diskcache/diskcache/__init__.py)
>>>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This aims to mitigate GHSA-w8v5-vhqr-4h9v by:
JSONDiskDiskcache backend