Repository navigation
Conversation
Member
|
As mentioned in the bug, this is not what we're going with. |
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.
glean_parser depends on
diskcache, whose last release, 5.6.3, is from August 2023. CVE-2025-69872 (GHSA-w8v5-vhqr-4h9v) is open against every version with no fix. Scanners report it for every glean_parser install, and upgrading isn't an option.This moves the only user,
fetch_remote_url(), to diskcache-community, a maintained, faster fork that keeps diskcache's API and file format. It's a pure-Python wheel with no dependencies, so nothing new to vendor beyond the package itself.Change
pyproject.tomldepends ondiskcache-community>=5.8.2instead ofdiskcache>=4. Inuv.lock, only the diskcache entries change.fetch_remote_url()opens the cache withSafeJSONDiskandon_error="miss".JSONDiskonly writes JSON, but it reads through diskcache's default code, so a row rewritten as a pickle gets unpickled.SafeJSONDiskreads the same files and refuses pickles, so caches from earlier releases still work.dc.get(key), becausekey in dcis true even for a row that can't be read.tests/test_utils.py, and a changelog entry.Speed is about the same. On an Apple M5 Pro with Python 3.12, a 20 KB cached entry reads in 28.9 µs (29.1 µs on diskcache 5.6.3) and writes in 48.6 µs (53.6 µs). The fork's benchmarks page has more.
Testing
make lintpasses.make test: 313 passed, 25 skipped.mainhas 311 passed and the same 6 jsonschemaRefResolverwarnings.JSONDisk, and with the oldkey in dclookup.diskcacheis no longer installed.On glean_parser 22.0.1 with diskcache 5.6.3:
With this change:
Script
The fork's docs cover moving from diskcache and what it changes for this CVE.
Pull Request checklist
make testruns without emitting any warnings (the 6 warnings above are the same onmain)make lintruns without emitting any errorsCHANGELOG.mdor an explanation of why it does not need one