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.
- Two downloads merge through redirects. When
apt-get install,apt upgradeorapt-get upgradefetches 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). - A retry resumes over the hard link. Since APT
2.3.2(Debian 12+ and Ubuntu 22.04+),Acquire::Retriesdefaults to"3". Many CI scripts andDockerfilerecipes also pass-o Acquire::Retries=3on older releases. The attacker sends a transient HTTP error, and APT retries with aRangerequest and resumes on a206 Partial Contentresponse. - The verified file is overwritten.
HttpMethod::DealWithHeaders()inmethods/http.ccopenedQueue->DestFilewithFileFd::WriteAnywithoutFileFd::Exclusive. The resumed write went through the hard link into a.debthat APT had already verified.dpkgthen unpacked the attacker’s package and ran itspreinst/postinstscripts asroot.
What to do now:
- Pass
-o Acquire::Retries=0when you upgradeaptitself. The old, vulnerableaptbinary downloads the patched package, so that last update is still exposed. Runsudo apt-get -o Acquire::Retries=0 update && sudo apt-get -o Acquire::Retries=0 install -y --only-upgrade apt, or writeAcquire::Retries "0";to/etc/apt/apt.conf.d/99-no-retriesfirst. - Upgrade
aptto the fixed release: Debian 13 (trixie)3.0.4, Debian 12 (bookworm)2.6.2, Ubuntu 22.04 LTS2.4.15ubuntu0.1, Ubuntu 24.04 LTS2.8.4ubuntu0.1, Ubuntu 26.04 LTS3.2.1ubuntu0.1and Ubuntu 26.103.3.3ubuntu0.1. Do this on hosts, self-hosted CI runners and base container images. - Rebuild Docker base images and CI runner images with
--pull --no-cacheso cached layers do not keep the vulnerableaptbinary. AddAcquire::Retries "0";to CI/CD workflows until runner images ship the patchedapt. - Move APT sources from
http://tohttps://where supported, so network intermediaries cannot inject redirects or partial responses.
Affected packages and distributions
| Distribution / release | Package | Affected versions | Fixed version | Default Acquire::Retries | Advisory ID |
|---|---|---|---|---|---|
Debian 13 (trixie), stable | apt | < 3.0.4 | 3.0.4 | "3" (vulnerable by default) | DSA-6607-1 / APT-2026-11-01 |
Debian 12 (bookworm), oldstable | apt | < 2.6.2 | 2.6.2 | "3" (vulnerable by default) | DLA-4880-1 / APT-2026-11-01 (one account: DSA-6607-1) |
| Ubuntu 26.10 | apt | < 3.3.3ubuntu0.1 | 3.3.3ubuntu0.1 | "3" (vulnerable by default) | USN-8996-1 |
Ubuntu 26.04 LTS (resolute) | apt | < 3.2.1ubuntu0.1 | 3.2.1ubuntu0.1 | "3" (vulnerable by default) | USN-8996-1 |
Ubuntu 24.04 LTS (noble) | apt | < 2.8.4ubuntu0.1 | 2.8.4ubuntu0.1 | "3" (vulnerable by default) | USN-8996-1 (one account: USN-7889-1) |
Ubuntu 22.04 LTS (jammy) | apt | < 2.4.15ubuntu0.1 | 2.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) | apt | All versions before the Ubuntu Pro / ELTS patch | Ubuntu 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
bookwormfix (2.6.2) shipped asDLA-4880-1. One saysDSA-6607-1covered bothtrixieandbookworm. The citedDSA-6607-1page is the primary source for this. - Ubuntu coverage. The account that cites
USN-7889-1lists only the 22.04 and 24.04 fixes. The accounts that citeUSN-8996-1list 22.04 through 26.10. - Ubuntu 26.10 codename. One account calls it
questing. Another labels the roworacular+. - Legacy severity. One account rates the
apt < 2.3.2releases High, and only when retries are above0.
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:
- Merge two downloads. APT requests two packages, for example
pkg-a.debandpkg-b.deb. The attacker redirects both requests to the same URL, so they share a queue path and a hard-linked inode. - 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 signedPackagesindex fromInRelease, and marks it ready fordpkg -i. On the merged transfer forpkg-b.deb, the attacker returns a transient HTTP error. WithAcquire::Retriesabove0, APT retries withReq.StartPos > 0(Range: bytes=...) and resumes on206 Partial Content. - Write through the shared inode. On the retry,
HttpMethod::DealWithHeaders()preparedReq.Fileto write the response, or to append atReq.StartPoson a206. It openedQueue->DestFilein place withFileFd::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:
- opens the existing partial file read-only (
partial.Open(Queue->DestFile, FileFd::ReadOnly)); - opens
Queue->DestFilewithFileFd::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; - copies the rescued prefix into the new file descriptor;
- 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.debcontrol files. This prevents a local DoS inPackageKit/aptdaemon.f5514f9c3a707f2357411010357e6549fe02860b(all releases): fixes an unbounded backward scan in the trailing-newline check ofpkgTagFile::Fill()on corrupt or malformeddeb822files.127c728db1(v1.2+): rejects.debarchives that lack aVersion:field indebDebFileParser.c7e7c23d60e898a00a160c97d7a7424a8351d4e1(v1.4+): stopsPushEntryWithKeyIDfrom advancing past the NUL terminator on unexpectedgpgvoutput.a0dd3cb508b06d452724faec0d1fae0ac57777ee(v1.2+): rejects DNSSRV(res_query) answers larger than the caller’s buffer insrvrec.54ec815244b9edc4f594390e984c681fc0cb5ded(v3.0+): makes the 3.0 solver’sworkLesscomparator 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 onAcquire::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 commits5af16a8ad0f155233dfb10b7c92ad1903112ef79forCVE-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:00to12:07 UTC): Julian Andres Klode publishesAPT-2026-11-01ondeity@lists.debian.org. Salvatore Bonaccorso publishesDSA-6607-1(apt 3.0.4for Debian 13trixie). Debian releasesDLA-4880-1(apt 2.6.2for Debian 12bookworm). Canonical publishesUSN-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 saysDSA-6607-1covered both3.0.4and2.6.2, and that Ubuntu publishedUSN-7889-1with2.8.4ubuntu0.1and2.4.15ubuntu0.1. - 2026-11-04 (
16:17 UTC): NVD publishesCVE-2026-109518. - 2026-11-04 (
20:55 UTC): Jan Schaumann relaysDSA-6607-1, commit5af16a8ad0f155233dfb10b7c92ad1903112ef79and theAcquire::Retries 0mitigation tooss-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
- Debian APT Team Advisory APT-2026-11-01 (Julian Andres Klode, 4 November 2026)
- Debian Security Advisory DSA-6607-1 (4 November 2026): apt security update (CVE-2026-109518)
- Debian Salsa apt commit 5af16a8ad0f155233dfb10b7c92ad1903112ef79 (methods: Open target files exclusively)
- oss-security (2026/11/04/12): CVE-2026-109518: RCE in apt(1) (DSA 6607-1)
- StepSecurity Research (5 November 2026): CVE-2026-109518: apt Flaw Lets Attackers Swap Packages After Verification and Run Code as Root
- NVD: CVE-2026-109518 Detail