Skip to content

[ci][docker] Install brotli>=1.2.1 in the base images (CVE-2026-111497) - #67846

Closed
elliot-barn wants to merge 2 commits into
masterfrom
elliot-barn/brotli-base-image
Closed

elliot-barn wants to merge 2 commits into
masterfrom
elliot-barn/brotli-base-image

Conversation

@elliot-barn

Copy link
Copy Markdown
Collaborator

Why are these changes needed?

Follow-up to #67789 (CVE-2026-111497 / GHSA-9v8h-qqgm-4m35, Brotli decoder OOB write, fixed in 1.2.1).

That PR pinned brotli==1.2.1 in every lock file, but the published rayproject/ray images never install brotli from a lock: the base_deps / base_extra locks contain no brotli entry, and the image's copy comes from the conda base env (conda-forge brotli-python, pulled in as a urllib3 dependency). The current nightly still ships the vulnerable version:

$ docker run --rm rayproject/ray:nightly conda list | grep brotli
brotli-python   1.2.0   py310h25d4438_3   conda-forge
$ docker run --rm rayproject/ray:nightly pip show brotli | grep Version
Version: 1.2.0

(trivy flags it as CVE-2026-111497 on rayproject/ray:nightly, nightly-gpu and nightly-cu128.)

This PR adds brotli>=1.2.1 to docker/base-deps/requirements.in and docker/base-slim/requirements.in (both images install miniforge) so the image locks carry brotli==1.2.1 and the existing uv pip install --no-deps -r python_depset.lock step replaces the conda copy with the fixed PyPI wheel. A conda pin (like the certifi one in docker/base-deps/Dockerfile) is not enough on its own: conda-forge only has brotli-python 1.2.1 builds for Python 3.11+, and we still build 3.10 images.

Verified the replacement path on the current nightly (py3.10):

$ uv pip install --system --no-deps brotli==1.2.1
 - brotli==1.2.0 (from file:///home/conda/feedstock_root/build_artifacts/brotli-split_.../work)
 + brotli==1.2.1
$ pip show brotli | grep Version      -> 1.2.1
$ python -c "import brotli; brotli.decompress(brotli.compress(b'ray'*1000))"   -> ok

Lock files regenerated with bazelisk run //ci/raydepsets:raydepsets -- build --all-configs; only brotli lines change.

Related issue number

Follow-up to #67789.

Checks

🤖 Generated with Claude Code

Follow-up to #67789. The lock files pin brotli==1.2.1, but the rayproject/ray
images never install brotli from a lock: the base_deps / base_extra / base_slim
locks had no brotli entry, and the image's copy comes from the conda base env
(conda-forge brotli-python, a urllib3 dependency), which is still 1.2.0 in the
current nightly.

Add brotli>=1.2.1 to docker/base-deps/requirements.in and
docker/base-slim/requirements.in so the image locks carry brotli==1.2.1 and the
existing `uv pip install --no-deps -r python_depset.lock` step replaces the conda
copy with the fixed PyPI wheel. A conda pin alone is not enough: conda-forge only
has brotli-python 1.2.1 builds for python>=3.11 and we still build 3.10 images.

Locks regenerated with `bazelisk run //ci/raydepsets:raydepsets -- build
--all-configs`; only brotli entries change.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@dstrodtman
dstrodtman marked this pull request as ready for review November 5, 2026 14:38
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Nov 5, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the brotli>=1.2.1 dependency to the base requirements to address a security vulnerability. It also updates the corresponding lock files to include the new dependency and its associated hashes. The reviewer identified that the CVE ID referenced in the comments of docker/base-deps/requirements.in and docker/base-slim/requirements.in is incorrect and should be updated to CVE-2024-11497 for accuracy.

Comment on lines +15 to +19
# Brotli: the conda base env already carries conda-forge's brotli-python (a
# urllib3 dependency), and conda-forge has no python 3.10 build of the
# CVE-2026-111497 fix (1.2.1). Listing it here makes the lock install replace
# the conda copy with the fixed PyPI wheel on every python version.
brotli>=1.2.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The CVE ID GHSA-9v8h-qqgm-4m35 corresponds to CVE-2024-11497, not CVE-2026-111497. Please correct the CVE reference in the comment to avoid confusion.

# Brotli: the conda base env already carries conda-forge's brotli-python (a
# urllib3 dependency), and conda-forge has no python 3.10 build of the
# CVE-2024-11497 fix (1.2.1). Listing it here makes the lock install replace
# the conda copy with the fixed PyPI wheel on every python version.
brotli>=1.2.1

Comment on lines +11 to +14
# Brotli: miniforge's base env carries conda-forge's brotli-python (a urllib3
# dependency) and conda-forge has no python 3.10 build of the CVE-2026-111497
# fix (1.2.1); listing it here makes the lock install replace the conda copy.
brotli>=1.2.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The CVE ID GHSA-9v8h-qqgm-4m35 corresponds to CVE-2024-11497, not CVE-2026-111497. Please correct the CVE reference in the comment to avoid confusion.

    # Brotli: miniforge's base env carries conda-forge's brotli-python (a urllib3
    # dependency) and conda-forge has no python 3.10 build of the CVE-2024-11497
    # fix (1.2.1); listing it here makes the lock install replace the conda copy.
    brotli>=1.2.1

@ray-gardener ray-gardener Bot added core Issues that should be addressed in Ray Core devprod security The issue or proposal related to security labels Nov 5, 2026
@elliot-barn

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #67596, which pins conda-forge brotli-python>=1.2.1 directly in the base-deps and base-slim Dockerfiles (PyPI wheel on 3.10, where conda-forge has no 1.2.1 build) instead of adding brotli to the image locks. Same resulting Brotli version in every image, no lock changes, and conda's own metadata stays consistent. Verified locally on both Dockerfiles for 3.10 and 3.12: Brotli 1.2.1 importable, no older copy left in site-packages, conda-meta/ or the conda package cache.

cc @dstrodtman since you marked this one ready this morning; #67596 is the one going in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core devprod go add ONLY when ready to merge, run all tests security The issue or proposal related to security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants