Skip to content

Commit f73143d

Browse files
lawrence-u10dclaude
andcommitted
fix(docker): purge uv wheel cache after opencv swap [security]
The 0.1.4 fix uninstalled opencv-python and installed the ffmpeg-free replacement, but the original wheel's extracted contents remained in ~/.cache/uv/archive-v0/.../opencv_python.libs/ (libavcodec.so.59.*, libavformat, libavutil, libswscale, libswresample, libavfilter, libavdevice). Image scanners walk the whole filesystem and still flagged the 14 ffmpeg CVEs from those cache files even though nothing links against them at runtime. Add `uv cache clean` at the end of the opencv replacement RUN so the vulnerable libs are evicted from the final image layer. Safe because UV_LINK_MODE=copy ensures installed files are independent copies, not cache hardlinks. Bumps service version 0.1.4 -> 0.1.5. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 03b57e0 commit f73143d

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.1.5
2+
3+
### Security
4+
5+
- **Purge uv wheel cache after opencv swap**: The 0.1.4 Dockerfile uninstalled the PyPI `opencv-python` wheel and installed the ffmpeg-free replacement, but the original wheel's extracted contents (including `libavcodec.so.59.*` and friends) remained in `~/.cache/uv/archive-v0/…/opencv_python.libs/`. Image scanners still flagged the 14 ffmpeg CVEs because they walk the whole filesystem. Added `uv cache clean` at the end of the opencv replacement `RUN` so the vulnerable libs are evicted from the final image layer.
6+
17
## 0.1.4
28

39
### Security

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,15 @@ RUN ARCH=$(uname -m) && \
113113
uv pip uninstall "$pkg" 2>/dev/null || true; \
114114
done && \
115115
uv pip install --no-deps /tmp/"${WHEEL}" && \
116-
rm /tmp/"${WHEEL}"
116+
rm /tmp/"${WHEEL}" && \
117+
# `uv pip uninstall` only drops the package from site-packages; the wheel
118+
# cache under ~/.cache/uv still holds the extracted opencv-python archive
119+
# (including its bundled `.libs/libavcodec.so.59.*` + friends). Scanners
120+
# see those files and still flag the 14 ffmpeg CVEs even though nothing
121+
# links against them at runtime. Wipe the cache so the image layer no
122+
# longer contains the vulnerable libs. Safe because UV_LINK_MODE=copy
123+
# ensures installed files are independent copies, not cache hardlinks.
124+
uv cache clean
117125

118126
COPY --chown=${NB_USER}:${NB_USER} CHANGELOG.md CHANGELOG.md
119127
COPY --chown=${NB_USER}:${NB_USER} logger_config.yaml logger_config.yaml
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.4" # pragma: no cover
1+
__version__ = "0.1.5" # pragma: no cover

0 commit comments

Comments
 (0)