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 Hub | apt in the image | Fixed apt | Fixed by |
|---|---|---|---|---|
debian:trixie, debian:trixie-slim (Debian 13) | 28 Oct | 3.0.3 | 3.0.4 | DSA-6607-1 |
debian:bookworm, debian:bookworm-slim (Debian 12) | 28 Oct | 2.6.1 | 2.6.2 | DLA-4880-1 |
ubuntu:26.04 | 29 Oct | 3.2.0 | 3.2.1ubuntu0.1 | USN-8996-1 |
ubuntu:24.04 | 29 Oct | 2.8.3 | 2.8.4ubuntu0.1 | USN-8996-1 |
ubuntu:22.04 | 29 Oct | 2.4.14 | 2.4.15ubuntu0.1 | USN-8996-1 |
ubuntu:20.04 | 9 Apr 2025 | 2.0.10 | 2.0.12+esm1, Ubuntu Pro only | USN-8996-1 |
debian:sid-slim | 28 Oct | 3.3.4 | 3.3.6 | Debian 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 afterdocker pull BASE, prints a name or number, the block fails withPermission denied. PutUSER rootbefore the block and, after the block and your ownapt-getlines, aUSERline with the name or number the command printed. - Multi-stage builds. Each
FROM ... AS namestarts again from its own base, so every stage that runsapt-getneeds the block. A stage builtFROManother stage that already has it does not. The step 1 check reads only the image you build; to read another stage, rundocker build --target NAME -t stage-check .and checkstage-check. - A Dockerfile that already runs
apt-get upgrade. The image may checkfixedwithout 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), 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.04without 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, becauseAcquire::Retrieswas 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::Retriesprints 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 anapt-getcommand. - Debian 11 (bullseye):
debian:bullseye-slimships 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:
| Command | Where | Result |
|---|---|---|
docker pull, then dpkg-query -W apt and /etc/os-release inside the image | each tag in the table, and debian:bullseye-slim | the 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 dash | each tag in the table, debian:bullseye-slim, python:3.14-slim, node:24-bookworm-slim | NOT 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 result | debian:trixie-slim, debian:bookworm-slim, ubuntu:26.04, ubuntu:24.04, ubuntu:22.04, python:3.14-slim, node:24-bookworm-slim | fixed: 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 |
| same | ubuntu:20.04, debian:sid-slim | apt 2.0.11 (not the Pro fix) and 3.3.6 |
same build with --network none | each tag above | the 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 network | debian:trixie-slim; debian:trixie-slim, debian:bookworm-slim, ubuntu:24.04, ubuntu:26.04 | the 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/ (image user 101); then USER root, the block, an apt-get install line, USER 101 | Permission 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 only | both: 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=0 | debian:bookworm-slim | Acquire::Retries "5";, then Acquire::Retries "0"; |
apt-config dump Acquire::Retries, without and with a file setting it to 3 | ubuntu:20.04 | nothing, 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.