From 35e312911e730fe4e37ec2719cfb81c9c9f695a2 Mon Sep 17 00:00:00 2001 From: RAHMAT AL ZAMI <112936589+zamibd@users.noreply.github.com> Date: Sat, 28 Nov 2026 20:56:25 +0000 Subject: [PATCH] Take musl 1.2.6-r6 from Alpine 3.25 to clear CVE-2026-107891 Alpine 3.24's musl 1.2.6-r3 already carries the patch for CVE-2026-107891, but Docker Scout lists the fix as 1.2.6-r6, the version in Alpine 3.25, and reports the image as vulnerable. alpine:3.25 is not yet published as a Docker image. musl and musl-utils 1.2.6-r6 have the same ABI and no dependencies, so the runtime stage installs them from the v3.25 repository for that one command; the image's repository list stays on 3.24. The package signatures verify against the keys in the 3.24 image. Remove MUSL_REPOSITORY once the base image is alpine:3.25 or later. --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index bdbbd2a..4de0ae1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -103,7 +103,17 @@ ENV NGINX_VERSION=${NGINX_VERSION} # "apk upgrade" matters: the Alpine base image is only rebuilt for Alpine # point releases, so the packages it ships (musl, zlib, ...) can be behind # the repository's security fixes. "apk add" alone would keep them. +# +# musl: CVE-2026-107891 is patched in Alpine 3.24's musl 1.2.6-r3, but +# vulnerability databases (Docker Scout among them) list the fix as +# 1.2.6-r6, the version in Alpine 3.25, and flag the image. musl 1.2.6-r6 +# has the same ABI and no dependencies, so it is taken from the 3.25 +# repository for this one command. Remove MUSL_REPOSITORY once the base +# image is alpine:3.25 or later. +ARG MUSL_REPOSITORY=https://dl-cdn.alpinelinux.org/alpine/v3.25/main RUN apk upgrade --no-cache \ + && apk add --no-cache --repository "${MUSL_REPOSITORY}" \ + 'musl>=1.2.6-r6' 'musl-utils>=1.2.6-r6' \ && addgroup -g 101 -S nginx \ && adduser -S -D -H -u 101 -h /var/cache/nginx -s /sbin/nologin -G nginx -g nginx nginx \ && apk add --no-cache \