Skip to content

fix(container): apt-get upgrade in runtime stage for Debian CVE patches#47

Open
matthew-on-git wants to merge 1 commit into
mainfrom
fix/debian-cve-2026-may
Open

fix(container): apt-get upgrade in runtime stage for Debian CVE patches#47
matthew-on-git wants to merge 1 commit into
mainfrom
fix/debian-cve-2026-may

Conversation

@matthew-on-git
Copy link
Copy Markdown
Contributor

Summary

Trivy's blocking OS-package scan failed on v1.11.2 (run 26108273647) with three HIGH vulnerabilities:

Library CVE Title
libcap2 CVE-2026-4878 Privilege escalation via TOCTOU race in cap_set_file()
libsystemd0 CVE-2026-29111 Arbitrary code execution / DoS via spurious IPC
libudev1 CVE-2026-29111 (same root cause, transitive)

All three have Debian-archive fixes available. The runtime stage's existing apt-get install doesn't refresh already-installed packages from the debian:bookworm-slim base, so newly-released CVE patches don't land until either (a) the base manifest gets updated, or (b) we explicitly apt-get upgrade.

Adding apt-get upgrade -y --no-install-recommends to the same layer as apt-get install is the canonical fix. Same layer keeps image size down.

Caveat: not validated locally

The local rebuild flaked on install-kotlin.sh with curl: (56) Failure when receiving data mid-build. Network blip, not related to the Dockerfile change. CI is the canonical validation environment for this kind of change — letting CI green-light it.

Heads-up: tag history

While debugging this I noticed v1.11.1 and v1.11.2 tags exist but neither has a corresponding chore(release): prepare ... commit, and neither triggered the Build and Publish Container workflow (the v1.11.1 tag actually points at the v1.11.0 release commit). They look like stale/accidental retags. After this PR merges, I'd suggest cutting via make release VERSION=1.11.3 so the CHANGELOG and tag are consistent again.

🤖 Generated with Claude Code

Trivy's blocking OS-package scan failed v1.11.2 with three HIGH
vulnerabilities — libcap2 CVE-2026-4878 (privilege-escalation TOCTOU
race) and libsystemd0/libudev1 CVE-2026-29111 (arbitrary code
execution / DoS). All three were "fixed" in Debian bookworm but the
versions installed by the base image's COPY were one patch behind.

Without an explicit `apt-get upgrade` step, the runtime image's
already-installed system libraries stay at whatever version the
debian:bookworm-slim manifest shipped — which lags Debian's security
archive by hours-to-days. Adding `apt-get upgrade -y
--no-install-recommends` to the same layer as the install step pulls
the latest patched versions of all base packages on every build.

The scheduled weekly build catches this drift via fresh layer caches,
but per-PR builds (like the v1.11.1/v1.11.2 tag pushes) need the
explicit upgrade.

NOT validated locally — the kotlin install step hit a flaky curl
exit 56 during my rebuild. The Dockerfile change is conceptually
trivial; CI will confirm.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant