[Snyk] Security upgrade python from 3.13.7-slim to 3.14.3-slim#28
[Snyk] Security upgrade python from 3.13.7-slim to 3.14.3-slim#28doublegate wants to merge 1 commit intomainfrom
Conversation
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-DEBIAN13-OPENSSL-15123186 - https://snyk.io/vuln/SNYK-DEBIAN13-OPENSSL-15123186 - https://snyk.io/vuln/SNYK-DEBIAN13-OPENSSL-15123186 - https://snyk.io/vuln/SNYK-DEBIAN13-OPENSSL-15123158 - https://snyk.io/vuln/SNYK-DEBIAN13-OPENSSL-15123166
Summary of ChangesHello @doublegate, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the security posture of the orchestrator service by updating its Docker base image. The change ensures that the application benefits from the latest security patches available in the newer Python version, thereby reducing the number of known vulnerabilities in the deployed environment. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull request overview
Upgrades the Orchestrator service’s Docker base image to a newer Python slim image to reduce known CVEs in the container OS/runtime layer.
Changes:
- Bump builder stage base image from
python:3.13.7-slimtopython:3.14.3-slim. - Bump runtime stage base image from
python:3.13.7-slimtopython:3.14.3-slim.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # syntax=docker/dockerfile:1 | ||
| # Orchestrator Service Dockerfile - Multi-stage build for production | ||
| FROM python:3.13.7-slim as builder | ||
| FROM python:3.14.3-slim as builder |
There was a problem hiding this comment.
This Dockerfile upgrade moves the production container to Python 3.14, but the repo’s GitHub Actions workflows currently run lint/tests on 3.12/3.13 (and some security jobs on 3.11). That means this runtime Python version isn’t exercised in CI, which increases the risk of a successful build but runtime-only incompatibilities. Consider aligning CI to include 3.14 (or keeping the container on a version covered by CI).
|
|
||
| # Runtime stage | ||
| FROM python:3.13.7-slim | ||
| FROM python:3.14.3-slim |
There was a problem hiding this comment.
After bumping the base image to Python 3.14, the runtime stage still copies dependencies from /usr/local/lib/python3.13/site-packages later in the Dockerfile. That path won’t exist in the 3.14 builder image, so the build will fail (or the runtime container will miss installed deps). Update the COPY paths to match the new Python minor version, or make the path version-agnostic (e.g., derive it via python -c during build).
There was a problem hiding this comment.
Code Review
This pull request, generated by Snyk, upgrades the Python base image from 3.13.7-slim to 3.14.3-slim in the orchestrator's Dockerfile to address security vulnerabilities. While this is a valuable security update, it introduces a critical build issue. A COPY instruction in the Dockerfile contains a hardcoded path to the old Python version (python3.13), which will cause the Docker build to fail with the new python3.14 base image. My review includes a comment that identifies this issue and suggests updating the path, along with a recommendation to use build arguments for the Python version to make future upgrades more robust.
| # syntax=docker/dockerfile:1 | ||
| # Orchestrator Service Dockerfile - Multi-stage build for production | ||
| FROM python:3.13.7-slim as builder | ||
| FROM python:3.14.3-slim as builder |
There was a problem hiding this comment.
This base image upgrade is a good security improvement. However, it introduces a critical issue that will likely break the Docker build.
The COPY instruction on line 43, which copies packages from this builder stage, has a hardcoded path to python3.13:
COPY --from=builder /usr/local/lib/python3.13/site-packages ...
Since this stage now uses Python 3.14, the correct path should be /usr/local/lib/python3.14/site-packages. The destination path on line 43 also needs to be updated to use python3.14.
To prevent this issue in the future, I recommend using a build argument for the Python version:
# At the top of the file
ARG PYTHON_MAJOR_VERSION=3.14
ARG PYTHON_IMAGE_TAG=3.14.3-slim
# In FROM statements
FROM python:${PYTHON_IMAGE_TAG} as builder
...
FROM python:${PYTHON_IMAGE_TAG}
# In COPY statement
...
COPY --from=builder /usr/local/lib/python${PYTHON_MAJOR_VERSION}/site-packages /usr/local/lib/python${PYTHON_MAJOR_VERSION}/site-packages
...This makes future upgrades much safer and easier.
Snyk has created this PR to fix 3 vulnerabilities in the dockerfile dependencies of this project.
Keeping your Docker base image up-to-date means you’ll benefit from security fixes in the latest version of your chosen image.
Snyk changed the following file(s):
services/orchestrator/DockerfileWe recommend upgrading to
python:3.14.3-slim, as this image has only 26 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected.Vulnerabilities that will be fixed with an upgrade:
SNYK-DEBIAN13-OPENSSL-15123186
SNYK-DEBIAN13-OPENSSL-15123186
SNYK-DEBIAN13-OPENSSL-15123186
SNYK-DEBIAN13-OPENSSL-15123158
SNYK-DEBIAN13-OPENSSL-15123166
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic
Learn how to fix vulnerabilities with free interactive lessons:
🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.