From d108046035e7e3e0dd197338a3c141be558f2d40 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Oct 2026 11:30:10 +0000 Subject: [PATCH 1/2] ROB-1636 Bump urllib3 to 2.8.0 and drop pip from the image to fix CVEs urllib3 2.7.0 -> 2.8.0 in pyproject.toml, poetry.lock, requirements.txt and enforcer/requirements.txt: CVE-2026-97687, CVE-2026-97689 (High). pip 26.2.1, the latest release, vendors its own urllib3 2.7.0, so the image kept the vulnerable copy even after the dependency bump. krr never calls pip at runtime, so the image now uninstalls it after installing requirements. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Fq7hqRqj2kshg8M2sFpN7h Signed-off-by: Claude --- Dockerfile | 3 +++ enforcer/requirements.txt | 2 +- poetry.lock | 8 ++++---- pyproject.toml | 2 +- requirements.txt | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 16302cef..0051d414 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,9 @@ RUN python -m ensurepip --upgrade # Bundled pip 25.0.1 wheel carries CVE-2025-8869, CVE-2026-3219/6357/8643 RUN rm -f /usr/local/lib/python3.12/ensurepip/_bundled/pip-*.whl RUN pip install --no-cache-dir -r requirements.txt +# pip 26.2.1 (latest) vendors urllib3 2.7.0 (CVE-2026-97687, CVE-2026-97689) and +# krr never calls pip at runtime, so drop it once dependencies are installed. +RUN pip uninstall -y pip # Copy the rest of the application code COPY ./krr.py krr.py diff --git a/enforcer/requirements.txt b/enforcer/requirements.txt index df9d0da7..b5eace3a 100644 --- a/enforcer/requirements.txt +++ b/enforcer/requirements.txt @@ -9,4 +9,4 @@ prometheus-client==0.20.0 python-json-logger==3.3.0 kubernetes==26.1.0 pyasn1>=0.6.2 -urllib3==2.7.0 +urllib3==2.8.0 diff --git a/poetry.lock b/poetry.lock index d705dc97..85839eca 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1901,13 +1901,13 @@ devenv = ["check-manifest", "pytest (>=4.3)", "pytest-cov", "pytest-mock (>=3.3) [[package]] name = "urllib3" -version = "2.7.0" +version = "2.8.0" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.10" files = [ - {file = "urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897"}, - {file = "urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c"}, + {file = "urllib3-2.8.0-py3-none-any.whl", hash = "sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3"}, + {file = "urllib3-2.8.0.tar.gz", hash = "sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63"}, ] [package.extras] @@ -1954,4 +1954,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.10,<=3.12.9" -content-hash = "6f07ded37f837aefc3e5129c7695e68086ae570aadd2e70d30a61b42df1b19e8" +content-hash = "54b390b357ffe8e8533721f88e5db5317700565bd70e9b8e4d6ebbe3fac4cff6" diff --git a/pyproject.toml b/pyproject.toml index a06fb565..bc458801 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ pyyaml = "6.0.1" # pytest-asyncio >=1.3 (needed for pytest 9 / CVE-2025-71176) requires typing-extensions >=4.12 typing-extensions = ">=4.12.0,<5" idna = "3.15" -urllib3 = "^2.7.0" +urllib3 = "^2.8.0" setuptools = "^83.0.0" # transitive deps pinned for CVE fixes pillow = "^12.3.0" diff --git a/requirements.txt b/requirements.txt index 421e258d..0d924313 100644 --- a/requirements.txt +++ b/requirements.txt @@ -51,7 +51,7 @@ typer==0.7.0 ; python_version >= "3.10" and python_full_version < "3.13" typing-extensions==4.16.0 ; python_version >= "3.10" and python_full_version < "3.13" tzdata==2024.1 ; python_version >= "3.10" and python_full_version < "3.13" tzlocal==5.2 ; python_version >= "3.10" and python_full_version < "3.13" -urllib3==2.7.0 ; python_version >= "3.10" and python_full_version < "3.13" +urllib3==2.8.0 ; python_version >= "3.10" and python_full_version < "3.13" websocket-client==1.7.0 ; python_version >= "3.10" and python_full_version < "3.13" zipp==3.20.2 ; python_version >= "3.10" and python_full_version < "3.13" # required for tests From a942cb3c80828cba32c67365621871384769914f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Oct 2026 11:54:11 +0000 Subject: [PATCH 2/2] ROB-1636 Install requirements and drop pip in a single image layer Uninstalling pip in a later RUN only hid the upgraded pip 26.2.1, and the urllib3 2.7.0 it vendors, behind a whiteout; the files stayed in a lower 13 MB layer. Doing the upgrade, install and uninstall in one RUN keeps them out of every layer. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Fq7hqRqj2kshg8M2sFpN7h Signed-off-by: Claude --- Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0051d414..65adabad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,15 +19,15 @@ WORKDIR /app COPY ./requirements.txt requirements.txt -RUN pip install --no-cache-dir --upgrade pip -# Install the project dependencies -RUN python -m ensurepip --upgrade -# Bundled pip 25.0.1 wheel carries CVE-2025-8869, CVE-2026-3219/6357/8643 -RUN rm -f /usr/local/lib/python3.12/ensurepip/_bundled/pip-*.whl -RUN pip install --no-cache-dir -r requirements.txt -# pip 26.2.1 (latest) vendors urllib3 2.7.0 (CVE-2026-97687, CVE-2026-97689) and -# krr never calls pip at runtime, so drop it once dependencies are installed. -RUN pip uninstall -y pip +# Install the project dependencies, then drop pip: 26.2.1 (latest) vendors +# urllib3 2.7.0 (CVE-2026-97687, CVE-2026-97689) and krr never calls pip at +# runtime. One RUN so the upgraded pip never lands in an image layer. +# The bundled pip 25.0.1 wheel carries CVE-2025-8869, CVE-2026-3219/6357/8643. +RUN pip install --no-cache-dir --upgrade pip \ + && python -m ensurepip --upgrade \ + && rm -f /usr/local/lib/python3.12/ensurepip/_bundled/pip-*.whl \ + && pip install --no-cache-dir -r requirements.txt \ + && pip uninstall -y pip # Copy the rest of the application code COPY ./krr.py krr.py