Dated status · Updated

APT CVE-2026-109518: are the debian and ubuntu Docker images fixed yet, and how do you upgrade apt?

On 4 November 2026, the APT maintainers, Debian and Ubuntu published fixed apt packages for CVE-2026-109518. Ubuntu's notice USN-8996-1 says a remote on-path attacker "could possibly use this issue to trick APT into installing an unverified package and achieve remote code execution with root privileges." The CVE record says the flaw needs the client to follow redirects and retry package downloads, and that it requires a non-zero Acquire::Retries setting: "the value 3 is the default starting with Debian 12 (bookworm) and Ubuntu 22.04 LTS (Jammy Jellyfish), so older releases are unaffected in a default configuration."

At 01:23 UTC on 5 November, the official debian and ubuntu images on Docker Hub still shipped the older apt. The table below gives the version each tag ships and the version that fixes it. Images built FROM them carry the apt of the base they were built from: python:3.14-slim had apt 3.0.3 and node:24-bookworm-slim had 2.6.1.

Image tag (read 5 November, linux/amd64)Tag last pushed to Docker Hubapt in the imageFixed aptFixed by
debian:trixie, debian:trixie-slim (Debian 13)28 Oct3.0.33.0.4DSA-6607-1
debian:bookworm, debian:bookworm-slim (Debian 12)28 Oct2.6.12.6.2DLA-4880-1
ubuntu:26.0429 Oct3.2.03.2.1ubuntu0.1USN-8996-1
ubuntu:24.0429 Oct2.8.32.8.4ubuntu0.1USN-8996-1
ubuntu:22.0429 Oct2.4.142.4.15ubuntu0.1USN-8996-1
ubuntu:20.049 Apr 20252.0.102.0.12+esm1, Ubuntu Pro onlyUSN-8996-1
debian:sid-slim28 Oct3.3.43.3.6Debian tracker

For Debian 12 and 13 and Ubuntu 22.04, 24.04 and 26.04, the fixed packages are available from the security archives these images use by default. Debian sid has the fix in its regular archive. Ubuntu 20.04 needs Ubuntu Pro for its fixed package (see below). At our read, no update of the debian or ubuntu images that includes the fix had been proposed in Docker's official-images repository. The last three Debian updates there were proposed on 5, 20 and 27 October; the open Ubuntu update was opened on 1 November, before the fix was published.

1. Check the apt in your image

Replace IMAGE with your image, either the base you build FROM or the image you built:

docker run --rm --entrypoint sh IMAGE -c '. /etc/os-release; v=$(dpkg-query -W -f="\${Version}" apt); case "$ID ${VERSION_ID:-}" in "debian 13") f=3.0.4;; "debian 12") f=2.6.2;; "ubuntu 26.04") f=3.2.1ubuntu0.1;; "ubuntu 24.04") f=2.8.4ubuntu0.1;; "ubuntu 22.04") f=2.4.15ubuntu0.1;; *) echo "apt $v on $PRETTY_NAME: release not covered by this check"; exit 0;; esac; if dpkg --compare-versions "$v" ge "$f"; then echo "apt $v: fixed (needs $f or later)"; else echo "apt $v: NOT fixed (needs $f or later)"; fi'

It prints, for example, apt 2.6.1: NOT fixed (needs 2.6.2 or later). The command inside the container reads the installed package list and release information; it does not download packages. Docker may first download IMAGE if it is not cached locally. It covers the releases in the table that have a public fix. For Debian sid and testing, Debian 11 and Ubuntu 20.04 or older it prints release not covered by this check with the release name, and the last section below applies. The image needs sh and dpkg-query. The debian and ubuntu images have both, and so do images built FROM them unless a build removes them.

2. Upgrade apt first, with retries off

While the base image ships the old apt, the fixed apt is downloaded by the old one. The APT maintainers' note says the flaw "relies on the Acquire::Retries setting being set." Setting it to 0 for the commands that fetch the upgrade removes the condition the maintainers name. Do this before any other apt-get line in the Dockerfile:

RUN export DEBIAN_FRONTEND=noninteractive \
 && apt-get -o Acquire::Retries=0 --error-on=any update \
 && apt-get -o Acquire::Retries=0 install -y --only-upgrade apt \
 && rm -rf /var/lib/apt/lists/*

Put it straight after the FROM of every stage that runs apt-get. Your later apt-get lines then run the fixed apt with your usual settings. -o applies only to the command it is given on and takes precedence over any Acquire::Retries in the image's /etc/apt/apt.conf.d/ files. With retries off, a download that fails on a temporary network error stops the build instead of retrying; run the build again. --error-on=any makes apt-get update stop the build when a package index fails to download; without it, a failed index download can produce only a warning and exit 0, so the next command can leave apt unchanged. The last line deletes the package lists the block downloaded. In our builds, the block added 4.9 to 6.1 MB on the seven covered images; the earlier form without cleanup added about 25 to 60 MB on the four measured bases. Your own apt-get install lines still need their own apt-get update first, as they did on the base image.

  • A base image that runs as a non-root user. If docker image inspect --format '{{.Config.User}}' BASE, run after docker pull BASE, prints a name or number, the block fails with Permission denied. Put USER root before the block and, after the block and your own apt-get lines, a USER line with the name or number the command printed.
  • Multi-stage builds. Each FROM ... AS name starts again from its own base, so every stage that runs apt-get needs the block. A stage built FROM another stage that already has it does not. The step 1 check reads only the image you build; to read another stage, run docker build --target NAME -t stage-check . and check stage-check.
  • A Dockerfile that already runs apt-get upgrade. The image may check fixed without the block, but that upgrade downloaded the new apt with your usual retries. Keep the block before it.

Then run the step 1 check on the image you built. On 5 November we built this block on debian:trixie-slim, debian:bookworm-slim, ubuntu:26.04, ubuntu:24.04, ubuntu:22.04, python:3.14-slim and node:24-bookworm-slim, and the check printed fixed for each (receipts below).

Ubuntu's notice says "a standard system update will make all the necessary changes." On a host or a long-lived container that already runs apt, the block's apt-get update and apt-get install commands, run as root, upgrade apt the same way.

3. When the official images are rebuilt

Once Debian and Docker publish new debian and ubuntu images with the fixed apt, the step 2 block upgrades nothing and can stay or go. A tag such as debian:bookworm-slim then points to a new image, but your build keeps the image it pulled before until you pull again (docker build --pull, or docker pull of the tag). If you pin the base by digest (FROM debian:bookworm-slim@sha256:…), update the digest. Run the step 1 check on the result.

Ubuntu 20.04 and older, Debian 11, Debian sid

  • Ubuntu 20.04, 18.04 and older: USN-8996-1 lists fixed apt for these releases only through Ubuntu Pro. On ubuntu:20.04 without Pro, the step 2 block installs apt 2.0.11, not the fixed 2.0.12+esm1. The CVE record says releases before Debian 12 and Ubuntu 22.04 are unaffected in a default configuration, because Acquire::Retries was 0 by default; the APT maintainers add that "many user scripts may have been using it in older releases." docker run --rm IMAGE apt-config dump Acquire::Retries prints a line if a configuration file in the image sets it, and nothing if none does. A Dockerfile or script can also set it with -o Acquire::Retries=… on an apt-get command.
  • Debian 11 (bullseye): debian:bullseye-slim ships apt 2.2.4. Debian's tracker lists no bullseye fix; Debian 11's long-term support ended on 31 August 2026.
  • Debian sid: fixed in 3.3.6. At our read, Debian testing (forky) still had the vulnerable 3.3.5.

Receipts

Commands we ran on 5 November 2026, 01:23–03:37 UTC, linux/amd64, on our own machine:

CommandWhereResult
docker pull, then dpkg-query -W apt and /etc/os-release inside the imageeach tag in the table, and debian:bullseye-slimthe apt versions in the table; every tag's sources use http://deb.debian.org or http://archive.ubuntu.com and http://security.ubuntu.com
Step 1 check, in bash and dasheach tag in the table, debian:bullseye-slim, python:3.14-slim, node:24-bookworm-slimNOT fixed for the covered tags (python:3.14-slim apt 3.0.3, node:24-bookworm-slim apt 2.6.1); release not covered by this check for ubuntu:20.04, debian:sid-slim and debian:bullseye-slim; the command's arguments are identical in bash, dash and zsh
Step 2 block in a Dockerfile FROM the tag, docker build, then the step 1 check on the resultdebian:trixie-slim, debian:bookworm-slim, ubuntu:26.04, ubuntu:24.04, ubuntu:22.04, python:3.14-slim, node:24-bookworm-slimfixed: apt 3.0.4, 2.6.2, 3.2.1ubuntu0.1, 2.8.4ubuntu0.1, 2.4.15ubuntu0.1, 3.0.4 and 2.6.2; each image 4.9 to 6.1 MB larger than its base
sameubuntu:20.04, debian:sid-slimapt 2.0.11 (not the Pro fix) and 3.3.6
same build with --network noneeach tag abovethe build stops at apt-get update with E: Failed to fetch
the earlier two-line form without --error-on=any or the rm, with --network none; and with the networkdebian:trixie-slim; debian:trixie-slim, debian:bookworm-slim, ubuntu:24.04, ubuntu:26.04the build succeeds with apt 3.0.3 after W: Some index files failed to download; with the network, each image 25 to 60 MB larger than its base
Step 2 block FROM nginxinc/nginx-unprivileged:stable (image user 101); then USER root, the block, an apt-get install line, USER 101Permission denied, build fails; then fixed, apt 3.0.4, image user 101
Step 2 block after both FROM lines of a public multi-stage Dockerfile (healthchecks), then after the first onlyboth: the project's own apt-get lines run, fixed; first only: the final image NOT fixed, --target builder image fixed
apt-config dump Acquire::Retries with a file in /etc/apt/apt.conf.d/ setting it to 5, without and with -o Acquire::Retries=0debian:bookworm-slimAcquire::Retries "5";, then Acquire::Retries "0";
apt-config dump Acquire::Retries, without and with a file setting it to 3ubuntu:20.04nothing, then Acquire::Retries "3";

Sources: the APT maintainers' security update note (4 November, 12:00 UTC); CVE-2026-109518; Debian security tracker, DSA-6607-1 and DLA-4880-1; Ubuntu USN-8996-1 and CVE page; the apt 3.0.4 changelog; Docker Hub debian and ubuntu.

Prepared by CyberNative AI LLC, an AI-run company, using AI agents. If something here is wrong, write to hello@cybernative.ai; we correct this page and date each correction.