critical

CVE

CVE-2026-109518, CVE-2019-3462

CWE

CWE-59, CWE-367, CWE-347, CWE-494, CWE-125

Affected Surface

  • Debian `apt` (`methods/http.cc`, `methods/rred.cc`, `methods/store.cc`) versions `< 3.0.4` on Debian 13 (`trixie`, `DSA-6607-1`) and `< 2.6.2` on Debian 12 (`bookworm`, `DLA-4880-1`), where `Acquire::Retries "3"` is enabled by default
  • Ubuntu `apt` versions `< 2.4.15ubuntu0.1` on Ubuntu 22.04 LTS (`jammy`), `< 2.8.4ubuntu0.1` on Ubuntu 24.04 LTS (`noble`), `< 3.2.1ubuntu0.1` on Ubuntu 26.04 LTS, and `< 3.3.3ubuntu0.1` on Ubuntu 26.10 (`USN-8996-1`), plus derivative distributions where `Acquire::Retries` is non-zero
  • Earlier Debian and Ubuntu releases (`apt < 2.3.2`) when `Acquire::Retries` is set to a value greater than `0` in `/etc/apt/apt.conf.d/`, CI workflow scripts, or `Dockerfile` instructions
  • CI/CD runners (`ubuntu-latest`, self-hosted runners), Docker image builds (`FROM debian:*`, `FROM ubuntu:*`, `FROM node:*`, `FROM python:*`, `RUN apt-get install`), developer workstations, and Linux hosts that fetch `.deb` packages over plain HTTP or through an untrusted mirror, caching proxy, or TLS-terminating proxy

TL;DR

On 4 November 2026, the Debian APT maintainers (APT-2026-11-01), Debian Security (DSA-6607-1, DLA-4880-1) and Canonical (USN-8996-1) disclosed CVE-2026-109518. The APT maintainers rate it Critical. NVD lists CVSS v4.0 7.7 High. EPSS is 0.93% (60.8th percentile). Max Justicz found it. He also found the 2019 APT HTTP redirect flaw CVE-2019-3462.

One account gives the Ubuntu notice as USN-7889-1 instead of USN-8996-1. No Ubuntu notice URL is among the references, so both IDs are kept here.

Debian and Ubuntu often fetch .deb packages over plain http:// mirrors (deb.debian.org, archive.ubuntu.com, azure.archive.ubuntu.com) or through caching proxies (apt-cacher-ng, Squid, corporate mirrors and egress proxies). That is by design: APT checks the PGP signature on InRelease / Release metadata and the SHA-256 hash of every .deb before it hands the file to dpkg. CVE-2026-109518 breaks the link between the file APT hashes and the file dpkg installs. It does not break the signature or the hash check.

  1. Two downloads merge through redirects. When apt-get install, apt upgrade or apt-get upgrade fetches two or more packages, an on-path attacker, compromised caching proxy or malicious mirror answers two different package requests with HTTP redirects to the same URI. APT merges the downloads and hard-links the destination file (Queue->DestFile).
  2. A retry resumes over the hard link. Since APT 2.3.2 (Debian 12+ and Ubuntu 22.04+), Acquire::Retries defaults to "3". Many CI scripts and Dockerfile recipes also pass -o Acquire::Retries=3 on older releases. The attacker sends a transient HTTP error, and APT retries with a Range request and resumes on a 206 Partial Content response.
  3. The verified file is overwritten. HttpMethod::DealWithHeaders() in methods/http.cc opened Queue->DestFile with FileFd::WriteAny without FileFd::Exclusive. The resumed write went through the hard link into a .deb that APT had already verified. dpkg then unpacked the attacker’s package and ran its preinst / postinst scripts as root.

What to do now:

  1. Pass -o Acquire::Retries=0 when you upgrade apt itself. The old, vulnerable apt binary downloads the patched package, so that last update is still exposed. Run sudo apt-get -o Acquire::Retries=0 update && sudo apt-get -o Acquire::Retries=0 install -y --only-upgrade apt, or write Acquire::Retries "0"; to /etc/apt/apt.conf.d/99-no-retries first.
  2. Upgrade apt to the fixed release: Debian 13 (trixie) 3.0.4, Debian 12 (bookworm) 2.6.2, Ubuntu 22.04 LTS 2.4.15ubuntu0.1, Ubuntu 24.04 LTS 2.8.4ubuntu0.1, Ubuntu 26.04 LTS 3.2.1ubuntu0.1 and Ubuntu 26.10 3.3.3ubuntu0.1. Do this on hosts, self-hosted CI runners and base container images.
  3. Rebuild Docker base images and CI runner images with --pull --no-cache so cached layers do not keep the vulnerable apt binary. Add Acquire::Retries "0"; to CI/CD workflows until runner images ship the patched apt.
  4. Move APT sources from http:// to https:// where supported, so network intermediaries cannot inject redirects or partial responses.

Affected packages and distributions

Distribution / releasePackageAffected versionsFixed versionDefault Acquire::RetriesAdvisory ID
Debian 13 (trixie), stableapt< 3.0.43.0.4"3" (vulnerable by default)DSA-6607-1 / APT-2026-11-01
Debian 12 (bookworm), oldstableapt< 2.6.22.6.2"3" (vulnerable by default)DLA-4880-1 / APT-2026-11-01 (one account: DSA-6607-1)
Ubuntu 26.10apt< 3.3.3ubuntu0.13.3.3ubuntu0.1"3" (vulnerable by default)USN-8996-1
Ubuntu 26.04 LTS (resolute)apt< 3.2.1ubuntu0.13.2.1ubuntu0.1"3" (vulnerable by default)USN-8996-1
Ubuntu 24.04 LTS (noble)apt< 2.8.4ubuntu0.12.8.4ubuntu0.1"3" (vulnerable by default)USN-8996-1 (one account: USN-7889-1)
Ubuntu 22.04 LTS (jammy)apt< 2.4.15ubuntu0.12.4.15ubuntu0.1"3" (vulnerable by default)USN-8996-1 (one account: USN-7889-1)
Debian 11 (bullseye) / Ubuntu 20.04 LTS (focal) and older (apt < 2.3.2)aptAll versions before the Ubuntu Pro / ELTS patchUbuntu Pro / ELTS patch; otherwise set Acquire::Retries "0";"0" (vulnerable only if apt.conf, CI scripts or Dockerfiles set Acquire::Retries > 0)USN-8996-1

Notes on the table:

  • Debian 12 advisory. Two accounts say the bookworm fix (2.6.2) shipped as DLA-4880-1. One says DSA-6607-1 covered both trixie and bookworm. The cited DSA-6607-1 page is the primary source for this.
  • Ubuntu coverage. The account that cites USN-7889-1 lists only the 22.04 and 24.04 fixes. The accounts that cite USN-8996-1 list 22.04 through 26.10.
  • Ubuntu 26.10 codename. One account calls it questing. Another labels the row oracular+.
  • Legacy severity. One account rates the apt < 2.3.2 releases High, and only when retries are above 0.

Technical analysis

1. Why redirect merging and HTTP resume gave a post-verification write

APT splits network transport from verification and install. The http method (methods/http.cc) runs as the unprivileged _apt user and writes into /var/lib/apt/lists/partial/ and /var/cache/apt/archives/partial/. dpkg runs as root. The method keeps a queue of FetchItem structures. The acquire scheduler links completed downloads to their final paths. Once a file’s SHA-256 digest matches the signed Packages index, the file in partial/ is hard-linked to its verified destination.

APT also avoids fetching the same URI twice. If two queued items resolve to the same URI after an HTTP 301 / 302 redirect, APT merges them and links their destination files. Both items then share one inode on disk.

An attacker who controls HTTP responses can be a malicious or compromised mirror, a rogue caching proxy, or an on-path attacker on a plain http:// source. The attack chains three steps:

  1. Merge two downloads. APT requests two packages, for example pkg-a.deb and pkg-b.deb. The attacker redirects both requests to the same URL, so they share a queue path and a hard-linked inode.
  2. Pass the hash check, then force a resume. The attacker serves the real bytes of pkg-a.deb. APT hashes the file, matches it to the signed Packages index from InRelease, and marks it ready for dpkg -i. On the merged transfer for pkg-b.deb, the attacker returns a transient HTTP error. With Acquire::Retries above 0, APT retries with Req.StartPos > 0 (Range: bytes=...) and resumes on 206 Partial Content.
  3. Write through the shared inode. On the retry, HttpMethod::DealWithHeaders() prepared Req.File to write the response, or to append at Req.StartPos on a 206. It opened Queue->DestFile in place with FileFd::WriteAny:
// methods/http.cc prior to commit 5af16a8ad0f155233dfb10b7c92ad1903112ef79
BaseHttpMethod::DealWithHeadersResult HttpMethod::DealWithHeaders(FetchResult &Res, RequestState &Req)
{
   auto ret = BaseHttpMethod::DealWithHeaders(Res, Req);
   if (ret != BaseHttpMethod::FILE_IS_OPEN)
      return ret;
   if (Req.File.Open(Queue->DestFile, FileFd::WriteAny) == false)
      return ERROR_NOT_FROM_SERVER;

In APT’s FileFd::Open() (apt-pkg/contrib/fileutl.cc), FileFd::Exclusive makes APT unlink() the path and then call open(..., O_CREAT | O_EXCL | O_RDWR). That cuts any hard link and gives the new file a fresh inode. Without the flag, Open() reused the existing inode, which was hard-linked to the verified .deb. The resumed bytes replaced the verified package with the attacker’s package before dpkg ran its maintainer scripts as root.

2. The fix: commit 5af16a8ad0f1

Julian Andres Klode wrote the fix in commit 5af16a8ad0f155233dfb10b7c92ad1903112ef79. It ships in APT 3.0.4 and 2.6.2. Accounts give the commit title as “methods: Open target files exclusively” or as “Do not write to existing files on download, patch, store”.

The commit passes FileFd::Exclusive whenever a method opens a target file for writing. Two accounts list the changed files as methods/http.cc, methods/rred.cc and methods/store.cc. One also lists methods/file.cc and methods/gpgv.cc.

When HttpMethod::DealWithHeaders() resumes a partial download (Req.StartPos > 0), it now:

  1. opens the existing partial file read-only (partial.Open(Queue->DestFile, FileFd::ReadOnly));
  2. opens Queue->DestFile with FileFd::WriteAny | FileFd::Exclusive, which unlinks the old path and creates a new, unshared inode, so a hard link to a verified file keeps the original bytes;
  3. copies the rescued prefix into the new file descriptor;
  4. rewinds to offset 0, so the whole file is hashed again.
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -1004,8 +1004,24 @@ BaseHttpMethod::DealWithHeadersResult HttpMethod::DealWithHeaders(FetchResult &R
    auto ret = BaseHttpMethod::DealWithHeaders(Res, Req);
    if (ret != BaseHttpMethod::FILE_IS_OPEN)
       return ret;
-   if (Req.File.Open(Queue->DestFile, FileFd::WriteAny) == false)
+
+   // If we are resuming, we first need to rescue the data we already have
+   FileFd partial;
+   if (Req.StartPos > 0 && FileExists(Queue->DestFile))
+   {
+      if (not partial.Open(Queue->DestFile, FileFd::ReadOnly))
+	 return ERROR_NOT_FROM_SERVER;
+   }
+   // Open the file exclusively to avoid injection attacks by links
+   if (Req.File.Open(Queue->DestFile, FileFd::WriteAny | FileFd::Exclusive) == false)
       return ERROR_NOT_FROM_SERVER;
+   if (partial.IsOpen())
+   {
+      // The exclusive open unlinked the old file; copy its content
+      // into the new one and rewind for hashing.
+      if (not CopyFile(partial, Req.File) || not partial.Close() || not Req.File.Seek(0))
+	 return ERROR_NOT_FROM_SERVER;
+   }
 
    FailFile = Queue->DestFile;
    (void)(FailFile.c_str()); // Make sure we don't do a malloc in the signal handler

3. Bundled libapt-pkg fixes in APT-2026-11-01

The APT-2026-11-01 advisory also backports parser, memory-safety and resource-exhaustion fixes across libapt-pkg. They matter for programs that parse untrusted .deb or deb822 files across a privilege boundary, such as PackageKit, aptdaemon and qapt running as root when they inspect local .deb files. One account counts six fixes. Another counts five. The full set from both accounts is below.

  • 8ab7abcf0aec378f46802aeace8a8184763b92d5 (v2.0+): guards against unsigned integer underflow when trimming trailing newlines from .deb control files. This prevents a local DoS in PackageKit / aptdaemon.
  • f5514f9c3a707f2357411010357e6549fe02860b (all releases): fixes an unbounded backward scan in the trailing-newline check of pkgTagFile::Fill() on corrupt or malformed deb822 files.
  • 127c728db1 (v1.2+): rejects .deb archives that lack a Version: field in debDebFileParser.
  • c7e7c23d60e898a00a160c97d7a7424a8351d4e1 (v1.4+): stops PushEntryWithKeyID from advancing past the NUL terminator on unexpected gpgv output.
  • a0dd3cb508b06d452724faec0d1fae0ac57777ee (v1.2+): rejects DNS SRV (res_query) answers larger than the caller’s buffer in srvrec.
  • 54ec815244b9edc4f594390e984c681fc0cb5ded (v3.0+): makes the 3.0 solver’s workLess comparator satisfy strict weak ordering.
  • Debian bug #1152704 (v2.6 / v2.8 / v3.0): stops repeated error-stack pushes when retrying delayed items. These pushes used to exhaust memory and fill disk logs.

Detection and remediation

1. Audit apt versions, Acquire::Retries, mirrors and proxies

Run these on Linux hosts, self-hosted CI runners and container base images:

# 1. Installed apt version and effective Acquire::Retries setting
apt --version
apt list --installed '?source-package(^apt$)' 2>/dev/null
apt-config dump Acquire::Retries
apt-config dump | grep -i '^Acquire::Retries\b'

# 2. Plain http:// sources and proxies
grep -rnE '^\s*(deb|URIs:)\s+http://' /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null || true
rg -n 'http://' /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null
apt-config dump Acquire::http::Proxy Acquire::https::Proxy

# 3. Dockerfiles and CI workflows that install packages, override retries, or use plain-HTTP mirrors
rg -n 'Acquire::Retries|apt(-get)?\s+(install|upgrade|dist-upgrade)|deb http://|http://(deb\.debian\.org|archive\.ubuntu\.com|security\.ubuntu\.com)' \
  Dockerfile* .github/workflows/ .gitlab-ci.yml 2>/dev/null

Compare the installed version with the fixed version in the table above.

2. Upgrade apt with retries disabled

The unpatched apt binary downloads the new apt package. Pass -o Acquire::Retries=0 on the command line when you apply the update over HTTP:

sudo apt-get -o Acquire::Retries=0 update
sudo apt-get -o Acquire::Retries=0 install --only-upgrade -y apt libapt-pkg*

Two accounts pass the option only to the install step (sudo apt-get update, then sudo apt-get install -y -o Acquire::Retries=0 --only-upgrade apt libapt-pkg*). One passes it to update as well, as above.

If you cannot upgrade right away, turn off retries persistently with a drop-in. The accounts use /etc/apt/apt.conf.d/99-no-retries or /etc/apt/apt.conf.d/99-cve-2026-109518-no-retries:

Acquire::Retries "0";

3. Harden GitHub Actions workflows and Dockerfiles until images are refreshed

In GitHub Actions workflows on ubuntu-latest (ubuntu-24.04 / ubuntu-22.04) or self-hosted Debian and Ubuntu runners, turn off retries before any step that installs .deb packages:

- name: Mitigate CVE-2026-109518 and upgrade apt
  run: |
    echo 'Acquire::Retries "0";' | sudo tee /etc/apt/apt.conf.d/99-cve-2026-109518-no-retries
    sudo apt-get update
    sudo apt-get install -y -o Acquire::Retries=0 --only-upgrade apt

In Dockerfiles based on debian:bookworm, debian:trixie, ubuntu:22.04 or ubuntu:24.04, upgrade apt with retries off in the first RUN layer. This includes language images such as node:22-bookworm and python:3.12-slim-bookworm. Build with docker build --pull --no-cache:

RUN echo 'Acquire::Retries "0";' > /etc/apt/apt.conf.d/99-no-retries \
    && apt-get update \
    && apt-get install --only-upgrade -y -o Acquire::Retries=0 apt \
    && rm -f /etc/apt/apt.conf.d/99-no-retries

One account removes the drop-in at the end of the layer, as above. Another leaves it in place (no -o flag and no rm -f line) for unpatched runner or container images.

4. Move sources to HTTPS

Switch /etc/apt/sources.list and /etc/apt/sources.list.d/*.sources from http:// to https:// where the mirror supports it. HTTPS stops an on-path network attacker from injecting the redirects or 206 Partial Content responses. You still need to patch apt, because HTTPS does not protect against an untrusted mirror or a TLS-terminating caching proxy.

Timeline

  • 2021 (APT 2.3.2): APT turns on Acquire::Retries "3" by default. Retries and HTTP resume become standard on Debian 12+ and Ubuntu 22.04+.
  • 2026-10-12 (20:49 UTC): Julian Andres Klode commits 5af16a8ad0f155233dfb10b7c92ad1903112ef79 for CVE-2026-109518, reported by Max Justicz. This date comes from one account. Another says the commit was pushed to Debian Salsa on 4 November alongside the advisory.
  • 2026-11-04 (12:00 to 12:07 UTC): Julian Andres Klode publishes APT-2026-11-01 on deity@lists.debian.org. Salvatore Bonaccorso publishes DSA-6607-1 (apt 3.0.4 for Debian 13 trixie). Debian releases DLA-4880-1 (apt 2.6.2 for Debian 12 bookworm). Canonical publishes USN-8996-1 (2.4.15ubuntu0.1, 2.8.4ubuntu0.1, 3.2.1ubuntu0.1, 3.3.3ubuntu0.1) for Ubuntu 22.04 LTS through 26.10. One account instead says DSA-6607-1 covered both 3.0.4 and 2.6.2, and that Ubuntu published USN-7889-1 with 2.8.4ubuntu0.1 and 2.4.15ubuntu0.1.
  • 2026-11-04 (16:17 UTC): NVD publishes CVE-2026-109518.
  • 2026-11-04 (20:55 UTC): Jan Schaumann relays DSA-6607-1, commit 5af16a8ad0f155233dfb10b7c92ad1903112ef79 and the Acquire::Retries 0 mitigation to oss-security (2026/11/04/12).
  • 2026-11-05: StepSecurity publishes CI/CD runner and container build guidance for CVE-2026-109518.

From research to remediation

Check whether this pattern exists in your codebase

Turn this research into a remediation workflow. Scan dependencies and package manifests for similar supply-chain risk, then prioritize fixes with reachability context.

References