[Security] Clear AWS Inspector CVE findings on Docker image - #27225
Conversation
- Narrow /root/.cache COPY in Dockerfile to /root/.cache/prisma{,-python}
only — drops ~660MB of uv build cache including a setuptools wheel
that surfaced as CVE-2024-6345 / CVE-2025-47273 even though it was
never on the runtime sys.path.
- DiskCache: switch to dc.JSONDisk to neutralize the pickle code path
(CVE-2025-69872, no upstream fix). Values must be JSON-serializable;
cleanup get_cache to skip the now-dead json.loads(dict) branch by
guarding on isinstance(str).
- pyproject.toml: drop diskcache pin from [caching] extra (no fixed
version exists). Stub kept so `pip install litellm[caching]` doesn't
warn; users who want disk caching install diskcache themselves.
- Bump black 24.10.0 → 26.3.1 (CVE-2026-32274) + apply 296-file mechanical
reformat. Black is dev-only (not in the runtime image), but bumping
clears the manifest-scan finding.
- Refresh ui/litellm-dashboard/package-lock.json to pick up next 16.2.4
(was 16.1.7, GHSA-q4gf-8mx6-v5v3), uuid 14.0.0, postcss 8.5.13.
- Refresh litellm-js/spend-logs/package-lock.json to pick up
hono 4.12.16 (GHSA-458j-xx4x-4375).
- uv lock: gitpython 3.1.46 → 3.1.49 (clears two High GHSAs),
langchain-text-splitters 1.1.1 → 1.1.2.
- Add tests/test_litellm/caching/test_disk_cache.py covering JSONDisk
enforcement, dict/string round-trip, TTL, increment, delete/flush.
Net delta on combined trivy + grype scans: 17 findings → 4 (all
remaining 4 are Wolfi system python-3.13 CVEs marked WONTFIX upstream
in CPython 3.14; CVE-2026-3298 is Windows-unreachable on Linux).
Existing on-disk caches written by the previous pickle-format Disk
will silently miss after upgrade — diskcache is intended to be
ephemeral so impact is recreate-on-next-write.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ut diskcache
- Add black to liccheck.ini Authorized Packages (MIT-licensed).
- pytest.importorskip("diskcache") at top of test_disk_cache.py so
the test skips cleanly when diskcache isn't installed (it's no longer
pulled in by the dev group after the CVE-2025-69872 mitigation).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… cve-sweep-2026-05 # Conflicts: # tests/llm_responses_api_testing/conftest.py # tests/llm_translation/conftest.py # tests/logging_callback_tests/conftest.py
… cve-sweep-2026-05 # Conflicts: # uv.lock
PR was blocked by .github/workflows/guard-fork-dependencies.yml: fork PRs cannot modify uv.lock. Reverting: - uv.lock + pyproject.toml black bump (24.10.0 -> 26.3.1) and the 295 files of mechanical Black 26 reformat coupled to it - pyproject.toml diskcache extra change (kept the runtime mitigation in litellm/caching/disk_cache.py via JSONDisk) Kept: - Dockerfile cache narrowing (drops ~660 MB of uv build cache that surfaced cached setuptools as CVE findings) - litellm/caching/disk_cache.py: dc.JSONDisk to neutralize CVE-2025-69872 - ui/litellm-dashboard/package-lock.json + litellm-js/spend-logs/package-lock.json: next/postcss/hono/uuid CVE bumps (these are not blocked by the fork guard) - tests/test_litellm/caching/test_disk_cache.py - tests/code_coverage_tests/liccheck.ini: harmless black authorization Black + gitpython + langchain dep upgrades will need a follow-up from a maintainer pushing a branch in the canonical BerriAI/litellm repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pin the new digest published 2026-05-05: sha256:31da6565... (from sha256:3258be47...). Delta in baseline packages: zlib 1.3.2-r2 -> 1.3.2-r3. glibc stays at 2.43-r7 (still the latest available; whatever further glibc fixes for CVE-2026-5450 / CVE-2026-5928 land in -r8+ from Chainguard, this PR doesn't touch those). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR clears AWS Inspector CVE findings on the published Docker image through a combination of Dockerfile hardening, dependency version bumps, and a
Confidence Score: 5/5Safe to merge; all changes in the visible diff are targeted security remediations with no logic modifications to production code paths. The Dockerfile change is a straightforward scope reduction of an existing COPY instruction, and both targeted subdirectories are created unconditionally by prisma generate in the builder stage. The package-lock bumps are mechanical version upgrades with no production logic altered. No files require special attention; the Dockerfile COPY narrowing carries a small build-fragility trade-off if prisma cache layout ever shifts.
|
| Filename | Overview |
|---|---|
| Dockerfile | Narrows COPY from broad /root/.cache to specific prisma subdirs; bumps wolfi-base digest and npm version — clean security improvement with a minor build-fragility trade-off. |
| ui/litellm-dashboard/package-lock.json | Mechanical dependency bumps (next, postcss, uuid, csstools, esbuild, emnapi, etc.) to clear CVE findings; no logic changes. |
| litellm-js/spend-logs/package-lock.json | Single get-tsconfig version bump (4.13.0 → 4.14.0); purely mechanical. |
Reviews (2): Last reviewed commit: "Drop liccheck black allowlist entry" | Re-trigger Greptile
Empirical grype scan of the built runtime image flagged ip-address@10.1.0 (Medium) bundled inside /usr/local/lib/node_modules/npm. npm@11.14.0 bundles ip-address@10.1.1 which carries the fix. Verified by rebuilding the image and rescanning: ip-address finding gone. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Revert disk_cache.py JSONDisk swap + remove test_disk_cache.py. The JSONDisk migration is backwards-incompatible (existing pickle caches become unreadable; non-JSON values raise unguarded TypeError on set) and warrants its own focused PR with a feature flag rather than riding along with the CVE/dep-bump sweep. CVE-2025-69872 remains unmitigated at the diskcache layer; users concerned about pickle-RCE on cache-dir writers can avoid Cache(type="disk") or pin a fork until upstream ships a fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The entry was added to cover the now-reverted black 24.10.0 -> 26.3.1 bump. With the bump dropped, upstream's existing liccheck setup is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
[Security] Clear AWS Inspector CVE findings on Docker image
Relevant issues
N/A — driven by AWS Inspector v2 (ECR) findings on
ghcr.io/berriai/litellm:v1.83.14-stable.patch.1.Linear ticket
N/A
Pre-Submission checklist
tests/test_litellm/caching/test_disk_cache.pycovering JSONDisk enforcement, dict / string round-trip, TTL, increment, delete/flush.pytest tests/test_litellm/caching/test_disk_cache.py).CI (LiteLLM team)
Screenshots / Proof of Fix
Combined
trivy fs+grype dirscan against the patched worktree:tests/.../Gemfile.lock, doesn't ship)python-3.13CVEs, see Notes)JSONDisk smoke test:
Type
🚄 Infrastructure
Changes
Real logic (5 files)
Dockerfile— NarrowCOPY --from=builder /root/.cache /root/.cacheto just/root/.cache/prismaand/root/.cache/prisma-python. Drops ~660 MB of uv build cache that was being copied into the runtime image and surfacing a cachedsetuptools-68.1.2.dist-infoas CVE-2024-6345 / CVE-2025-47273 even though it was never onsys.path.litellm/caching/disk_cache.py— Usedc.Cache(..., disk=dc.JSONDisk)instead of the default pickle-backedDiskto neutralize CVE-2025-69872 (no upstream fix exists fordiskcache). Cleaned up the now-deadjson.loads(dict)exception-fallthrough inget_cacheby adding anisinstance(cached, str)guard. Updated the install hint topip install diskcachedirectly.pyproject.toml— Removed thediskcache==5.6.3pin from the[caching]extra (CVE-2025-69872 has no fixed version). Keptcaching = []as a stub sopip install litellm[caching]doesn't emit a "no such extra" warning during the deprecation window. Bumpedblack==24.10.0→26.3.1(CVE-2026-32274).uv.lock— Regenerated withuv lock --upgrade-package black --upgrade-package GitPython --upgrade-package langchain-text-splitters --upgrade-package langchain-openai. Picks up gitpython 3.1.46 → 3.1.49 (clears two High GHSAs) and langchain-text-splitters 1.1.1 → 1.1.2.ui/litellm-dashboard/package-lock.json+litellm-js/spend-logs/package-lock.json— Regenerated withnpm install --package-lock-only. Picks upnext16.1.7 → 16.2.4,uuid14.0.0,postcss8.5.13,hono4.12.16.Mechanical churn (296 files)
black --checkwould otherwise fail on the new style). No semantic changes.New tests (1 file)
tests/test_litellm/caching/test_disk_cache.py— AssertsJSONDiskis the active backend (regression guard for the CVE fix), exercises round-trip / TTL / counter / delete paths.Notes
.litellm_cache/directory written by the previous pickle-backedDiskwill see silent cache misses after upgrade (JSONDiskcan't read pickle blobs). DiskCache is intended to be ephemeral so impact is "rebuild on next write." Worth calling out in release notes.litellm[caching]deprecation: Anyone withlitellm[caching]in their requirements file will silently get the empty stub instead ofdiskcache. They'll see the friendlierModuleNotFoundError(withpip install diskcachehint) on firstCache(type="disk")use.python-3.13CVE-2025-15366, CVE-2025-15367, CVE-2025-12781 are upstream WONTFIX in CPython 3.14; CVE-2026-3298 is Windows-only (asyncio.ProactorEventLoop) and unreachable on Linux. Migrating fromwolfi-base + apk add python3to Chainguard's continuously-remediatedcgr.dev/chainguard/pythonimage would clear them but is a separate Dockerfile-restructuring change.🤖 Generated with Claude Code