Skip to content

Commit 1de0fb3

Browse files
committed
Patch TPU for emSign/eMudhra vulnerability.
http://b/576329498
1 parent b538b19 commit 1de0fb3

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎Dockerfile.tmpl‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN cat /kaggle_requirements.txt >> /requirements.txt
1616
# GHSA-hq85-5cpj-mr62: uv < 0.13.4 vendors a CA bundle that trusts emSign intermediates with compromised keys.
1717
# Upgrade it first so the patched uv performs all subsequent installs.
1818
# The base image's uv may not be the pip-managed one, so point every uv on PATH at the new binary.
19+
# TODO(b/576329498): Remove once base image ships with newer uv, pip and certifi packages.
1920
RUN uv pip install --system --no-cache "uv>=0.13.4" && \
2021
NEW_UV="$(python -c 'import uv; print(uv.find_uv_bin())')" && \
2122
for old in $(which -a uv); do [ "$old" -ef "$NEW_UV" ] || ln -sf "$NEW_UV" "$old"; done

‎tpu/Dockerfile‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ ADD patches/kaggle_datasets.py /root/.local/lib/${PYTHON_VERSION_PATH}/site-pack
2828
# Prereqs
2929
# This is needed for cv2 (opencv-python):
3030
# https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
31+
# GHSA-6q48-6c7w-9gw2: emSign ECC Root CA - G3 issued intermediates with compromised keys.
32+
# Debian's trixie-security ca-certificates 20250419+deb13u1 blocklists it in the system store.
33+
# TODO(b/576329498): Remove upgrade to ca-certificates once the base image ships the newer version.
3134
RUN /tmp/clean-layer.sh && \
3235
apt-get update && \
36+
apt-get install --no-install-recommends -y --only-upgrade ca-certificates && \
3337
apt-get install --no-install-recommends -y ffmpeg libsm6 libxext6 && \
3438
/tmp/clean-layer.sh
3539

@@ -42,8 +46,12 @@ RUN envsubst < /kaggle_requirements.in > /requirements.in
4246

4347
# Install uv and then install the requirements:
4448
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
45-
RUN export PATH="${HOME}/.local/bin:${PATH}" && \
46-
uv pip compile --system --prerelease=allow \
49+
ENV PATH="~/.local/bin:${PATH}"
50+
# TODO(b/576329498): Remove once the base image ships pip >= 26.2.2 itself.
51+
RUN uv pip install --system "pip>=26.2.2" && \
52+
uv cache clean && \
53+
/tmp/clean-layer.sh
54+
RUN uv pip compile --system --prerelease=allow \
4755
--verbose \
4856
--upgrade \
4957
--find-links=https://storage.googleapis.com/jax-releases/libtpu_releases.html \
@@ -59,7 +67,6 @@ RUN export PATH="${HOME}/.local/bin:${PATH}" && \
5967
-r /requirements.txt && \
6068
uv cache clean && \
6169
/tmp/clean-layer.sh
62-
ENV PATH="~/.local/bin:${PATH}"
6370

6471
# We install a libtpu version compatible with both jax 0.7.2 and torch 2.8.0.
6572
# Why? tunix latest -> flax 0.12 -> jax 0.7.2 -> libtpu 0.0.23. However, that

0 commit comments

Comments
 (0)