Repository navigation
fix(docker): install current Pillow and torch dependencies in the image - #239
Merged
Merged
Conversation
The image installs torch and torchvision from the PyTorch CPU index first. That step also took their dependencies from the CPU index, which carries Pillow 12.3.0 at most, and the later requirements install left the satisfied Pillow in place. Images therefore shipped Pillow 12.3.0 even after Pillow 13.0.0 fixed a large set of decoder vulnerabilities, and filelock and setuptools lagged in the same way. Install only torch and torchvision from the CPU index and let the requirements install resolve their dependencies from PyPI. Require Pillow 13.0.0 so existing environments upgrade too. Upgrade pip before installing, since the base image's pip 25.0.1 has known install-time vulnerabilities. Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
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
Images built from
mainship Pillow 12.3.0, and rebuilding does not change that.The torch step also installed the dependencies of torch and torchvision from the PyTorch CPU index, which carries Pillow 12.3.0, filelock 3.32.3 and setuptools 78.1.0 at most. The requirements install then found
Pillow>=10.0.0already satisfied and left it alone. Pillow 13.0.0 fixes 41 advisories, including heap overflows in JPEG decoding (CVE-2026-112403, CVE-2026-96778), FlashPix decoding (CVE-2026-112398) and the bundled OpenJPEG (GHSA-78g4-xqwv-q3g8). Uploaded images are decoded with Pillow.With
--no-deps, only torch and torchvision come from the CPU index, and the requirements install resolves their dependencies from PyPI. The torch wheels stay CPU-only, and no CUDA packages are installed.Pillow>=13.0.0makes existing development environments upgrade as well. It needs rembg 2.0.86 or later, because 2.0.85 capped Pillow below 13; pip selects it.The base image ships pip 25.0.1, which has known install-time vulnerabilities, so pip is upgraded before the installs.
Evidence
ghcr.io/tracefinity/tracefinity:0.10.0): Pillow 12.3.0, certifi 2026.7.22, filelock 3.32.3, setuptools 78.1.0 and pip 25.0.1. pip-audit (OSV) reports 54 advisories across those five packages.After (local arm64 build of this branch with build(deps): update frontend dependencies for security advisories #238): Pillow 13.0.0, certifi 2026.10.23, filelock 4.2.4, setuptools 84.2.1, pip 26.2.2 and torch 2.14.1+cpu. pip-audit (PyPI and OSV) reports no known vulnerabilities in the 101 installed packages, and
pip checkreports no broken requirements.tracefinityuser: 852 passed./and/api/versionreturn 200 through nginx, and the backend/healthreturns{"status":"ok"}.Merge Danger
Door: two-way
Blast Radius: image
Pillow 13 is a major release. The backend suite passes against it in the image, and CI's backend tests install it as well.