Repository navigation
fix(docker): upgrade curl and OpenSSL explicitly so a cached layer can't keep old ones - #648
Merged
Merged
Conversation
…n't keep old ones The release build restored the runtime stages' package layers from the registry build cache, so api and ops-agent kept curl 8.22.0-r0 (CVE-2026-92392) and data-manager, transitous-runner and transitous-tools kept libssl3 3.0.22-1~deb12u1 (CVE-2026-84782). Each stage now names those packages and checks a minimum version after installing them. That changes the cached instruction, so the old layer isn't reused, and it fails the build on a mirror without the fix. In ops-agent the upgrade moves after the install, since apk upgrade skips packages not yet installed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Main's release build for
979850a(run 40362337568) failed the Trivy gate on five images, so nothing was published:One cause for both. None of these packages is in a base image. Each comes from the runtime stage's own
apk addorapt-get install, which installs the current version only when the step actually runs. The release build passescache-from: type=registry,ref=ghcr.io/openmapx/<app>:buildcache. An unchanged instruction is restored from that cache, with the packages it held when it was cached. #647 assumedapk add curlalways fetches the fixed version; that holds only on a cold build.A newer base digest can't fix the Debian images either.
node:24.22.1-slimanddebian:bookworm-slimcontain no libssl3; curl, git, Python and ca-certificates pull it in. No official nginx or node Alpine image changes the Alpine side.The fix, in each runtime stage:
curl libcurljoin the stage's existingapk upgrade --no-cache …, followed by a version floor:apk query --fields version libcurland requiresapk version -t … 8.23.0-r0to be at least that version.apk add:apk upgradeof a package that isn't installed yet exits 0 and does nothing, so placed first it would have fixed nothing.libssl3 opensslare named in the existingapt-get install, with thedpkg --compare-versions … ge 3.0.22-1~deb12u2floor these Dockerfiles already use for Expat, PCRE2 and Brotli.opensslis installed in all three (ca-certificates depends on it), so it gets the same treatment.ghcr.io/openmapx/web:latesthas neither curl nor libcurl, and its node Alpine base has none.How this keeps a cached package layer from reintroducing a fixed CVE:
RUNlayer's cache on its command text, so naming the package and adding the floor gives the step a new key, and the old cached layer is not reused. The baseline below shows the old layer being reused without this change.maxColdRefreshAge, 7 days,no-cache: trueindocker.yml) rebuilds every image without cache, and raising a floor fixes it at once.Verification
Each image was built locally like the release builds it:
docker buildx build --platform linux/amd64 --pull --cache-from type=registry,ref=ghcr.io/openmapx/<app>:buildcache, read through a temporary, since-deleted Docker config. Each was then scanned with Trivy 0.75.0 at the release gate's settings:vuln,os,library,CRITICAL,HIGH,--ignore-unfixed,.trivyignore.yaml, exit code 1.CACHEDDONE 19.4s)DONE 72.2s)DONE 65.1s)DONE 56.6s)scripts/check-infrastructure.sh(actionlint, ShellCheck, Hadolint) passes with no new findings.check-dockerfile-sync,check-docker-context-secretsand the Docker release-plan, release-contract and supply-chain tests (82) pass.linux/amd64only.Release and upgrade impact
Product impact: ordinary
Only image contents change: the same packages at their fixed versions. The images reach hosts with the next published release.