Repository navigation
fix(docker): upgrade apt for CVE-2026-109518 - #698
Conversation
The pinned Python base images have apt 3.0.3; the fix, 3.0.4, is in trixie-security. Upgrade apt and libapt-pkg7.0 in the base stage, so that a later rating of the CVE as high or critical can't fail the scan of a tagged commit. The upgrade can go once all base images have it. Closes #697 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #698 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 66 66
Lines 8588 8588
=========================================
Hits 8588 8588
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@sourcery-ai review |
Reviewer's GuideThe PR mitigates CVE-2026-109518 by upgrading Flow diagram for the Docker apt vulnerability fixflowchart TD
A[Pinned Python base image] --> B[base stage]
B --> C[apt-get update]
C --> D[Upgrade apt and libapt-pkg7.0 to 3.0.4]
D --> E[Remove /var/lib/apt/lists]
E --> F[Derived FOCA images]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/test_image_requirements.py" line_range="47-48" />
<code_context>
+ text = (ROOT / "docker/Dockerfile").read_text()
+ base_stage = text.partition(" AS base\n")[2].partition(" AS builder\n")[0]
+ assert re.search(
+ r"^\s*apt-get install -y --no-install-recommends --only-upgrade "
+ r"apt libapt-pkg7\.0\b",
+ base_stage,
+ re.M,
</code_context>
<issue_to_address>
**Disabled upgrade still passes**
When the matched command is present only in a non-executed shell branch, `test_base_stage_upgrades_apt`'s `re.search` at lines 46–50 matches the literal install command even inside a non-executed shell branch, so the test passes although the image does not upgrade apt.
Verify the built image's apt package version, or otherwise ensure the matched command is in an executed `RUN` path.
</issue_to_address>Linked issues
#697 fix(docker): upgrade apt for CVE-2026-109518 · 2 of 2 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Upgrade apt and libapt-pkg7.0 in the base stage so the image has the fix regardless of the pinned base image. |
✅ Met | The base stage updates package metadata and upgrades both packages; the PR reports verifying version 3.0.4 in builds. |
| 2 | Ensure images built on the FOCA image also get the fixed apt. |
✅ Met | The upgrade is in base, which later stages inherit. |
Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: tests/test_image_requirements.py:48
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Linked issues
#697 fix(docker): upgrade apt for CVE-2026-109518 · 3 of 3 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Upgrade apt and libapt-pkg7.0 in the base stage so the image has the fix regardless of the pinned base images. |
✅ Met | The base stage updates package lists and upgrades both packages. |
| 2 | Ensure images built on the FOCA image also get the fixed apt for their own package installs. |
✅ Met | Both the builder and final stages derive from base. |
| 3 | Make the temporary upgrade removable once all pinned base images have the fix. | ✅ Met | The Dockerfile comment records when the upgrade can be removed. |
Sourcery assessment
Approved.
Summary
Upgrades
aptandlibapt-pkg7.0to 3.0.4 in thebasestage ofdocker/Dockerfile, which fixes CVE-2026-109518 (code scanning alerts #541 and #542). The pinned Python base images still have 3.0.3, and the newest upstream images checked today have the same digests.The severity is
UNKNOWN, so scans don't fail today. A rating of high or critical before the base images are rebuilt would fail the release scan of a tagged commit, after its images are pushed. The contributing guide now names this way of fixing a system package.Closes #697
Verification
tests/test_image_requirements.py: the new test failed before the change, and 18 pass now.docker buildfor Python 3.11 and 3.15 before and after the change:aptandlibapt-pkg7.0went from 3.0.3 to 3.0.4. The container runs as user 1000, reports the expected FOCA version, has thefocascript and no pip, and/var/lib/apt/listsis empty.adversarial-reviewerandquality-reviewer, one round.dev.Declined review findings
Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Upgrade apt in the base Docker image to address CVE-2026-109518 until updated pinned base images are available.
Bug Fixes:
Enhancements:
Tests: