Repository navigation
Conversation
…69872) Signed-off-by: August Vi <augustvilakia@gmail.com>
This branch has not been deployed
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.
Summary
InferenceEngine.prepare()opens a diskcacheCachein./inference_engine_cache/<engine class>/(prepare(), default path), andinfer()looks up each instance there before calling the model (L275). The defaultDiskpasses any pickled entry topickle.load, so a file dropped into that folder runs code in the evaluation process. That is CVE-2025-69872 (GHSA-w8v5-vhqr-4h9v); diskcache stopped at 5.6.3 in 2023, which is affected, and scanners flag every unitxt install for it (issue 1972).Fixes #2000
Changes
diskcache-community>=5.8.4replacesdiskcachein the core dependencies and thetests,inference-testsandremote_inferenceextras, and inLiteLLMInferenceEngine._requirements_list.SafeDisk.with_types(TextGenerationInferenceOutput).with_options(on_error="miss"), since predictions are plain values or that class; a refused entry is deleted and the model is asked again.infer()already reads with oneget().Cachegets plainSafeDiskfor the SQL API's JSON results, so a refused entry raisesUnpicklingErrorthere.test_execute_query_does_not_unpickle_cached_resultplants a pickle under a query's cache key and checks thatexecute_queryneither runs it nor posts to the API.unitxtrecipe listsdiskcache, and conda-forge has no diskcache-community package yet, so the recipe needs one first.Update
Every day new libraries getting updated, as example several libraries that were updated yesterday lithops and octotools.
improved performance
Measured over 20 rounds per build, each build in its own venv in random order, medians vs PyPI diskcache 5.6.3 — classic mix (100,000 ops/round, 90% gets / 9% sets / 1% deletes) plus size tiers (100 B to 1 MB) and Django backends, millions of ops total.
Cache.gethitCache.getmissDjangoCache.gethitCache.setCache.setwith expire / Django setBefore and after
The script fakes the Ollama client, then overwrites the cached prediction with a pickle that calls
planted(), a function in the script that prints one line and answers'Toronto'.On unitxt 1.26.10 with diskcache 5.6.3:
With this change:
Script
Test plan
On macOS with Python 3.12:
python -m pytest tests/library/test_text2sql_utils.py: 23 passed, the new test among them.Diskback intext2sql_utils.py, the new test fails because the planted code runs.ruff checkandruff format --checkon the changed files: no new findings.