From 4616821c8c49e38ae01a06b054dcc0a55a261bc5 Mon Sep 17 00:00:00 2001 From: Oliver Pohl Date: Sat, 24 Oct 2026 13:09:37 +0200 Subject: [PATCH] Remove diskcache diskcache is unmaintained since 2023 and has an unfixed vulnerability (CVE-2025-69872, unsafe pickle deserialization). Cache() without a directory used a temporary folder per worker process, so a plain dict keeps the same behaviour (per worker, no expiry), only in memory. --- Dockerfile.dev | 2 +- app/controller.py | 3 +-- poetry.lock | 18 +++--------------- pyproject.toml | 1 - 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index 19fd0d2..f64db8e 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -2,7 +2,7 @@ FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11-2025-02-10 WORKDIR /app -RUN pip install poetry lxml snakesist python-dotenv diskcache +RUN pip install poetry lxml snakesist python-dotenv COPY ./pyproject.toml ./poetry.lock* ./ diff --git a/app/controller.py b/app/controller.py index 7565f52..e80d2d0 100644 --- a/app/controller.py +++ b/app/controller.py @@ -10,7 +10,6 @@ from random import choice from string import ascii_letters from pathlib import Path -from diskcache import Cache from service import Service, beacon_service, cmif_service, image_service, letter_index_service from models import EntityMeta @@ -33,7 +32,7 @@ db.root_collection = ROOT_COLLECTION service = Service(db, CFG, watch_updates=True) -cache = Cache() +cache: dict = {} app = FastAPI() meta = {} diff --git a/poetry.lock b/poetry.lock index 4910440..f7d7c7b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.4.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.5.1 and should not be changed by hand. [[package]] name = "aiofiles" @@ -464,18 +464,6 @@ lxml = "*" [package.extras] https-loader = ["httpx[brotli,http2]"] -[[package]] -name = "diskcache" -version = "5.6.3" -description = "Disk Cache -- Disk and file backed persistent cache." -optional = false -python-versions = ">=3" -groups = ["main"] -files = [ - {file = "diskcache-5.6.3-py3-none-any.whl", hash = "sha256:5e31b2d5fbad117cc363ebaf6b689474db18a1f6438bc82358b024abd4c2ca19"}, - {file = "diskcache-5.6.3.tar.gz", hash = "sha256:2c3a3fa2743d8535d832ec61c2054a1641f41775aa7c556758a109941e33e4fc"}, -] - [[package]] name = "et-xmlfile" version = "2.0.0" @@ -1106,7 +1094,7 @@ files = [ ] [package.dependencies] -typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" +typing-extensions = ">=4.6.0,!=4.7.0" [[package]] name = "pygments" @@ -1369,4 +1357,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = "^3.13" -content-hash = "3f9b762202d5169076bf0851956fe6948eea713a0bf957cd0f1952d794d1ca16" +content-hash = "0168c187f000c342bd98534a70f946148c254f9359e95eeb9e0f2f5deef01b2f" diff --git a/pyproject.toml b/pyproject.toml index 893a600..b438b74 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,6 @@ fastapi = "^0.141.1" pyyaml = "^6.0.2" schedule = "^1.2.2" xmltodict = "^0.14.2" -diskcache = "^5.6.3" aiofiles = "24.1.0" Pillow = "^12.3.0" openpyxl = "^3.1.5"