Security

CVE-2026-109518: how to patch and mitigate the APT root flaw

Key takeaways

  • An on-path attacker can use CVE-2026-109518 to install an unsigned package and gain root
  • Debian trixie is fixed in APT 3.0.4; Ubuntu 22.04 LTS and newer are affected by default
  • Setting Acquire::Retries to 0 or switching sources to HTTPS mitigates the flaw until you patch

After reading this guide, a sysadmin or Linux user will be able to work out whether a Debian or Ubuntu machine is exposed to CVE-2026-109518, apply a stop-gap mitigation, and install the fix. Difficulty: easy.

The flaw, found by Max Justicz and disclosed responsibly, sits in the HTTP backend of APT, the package manager used by Debian, Ubuntu and their derivatives. Debian published it as DSA 6607-1; Ubuntu rates it High with a CVSS 4.0 score of 7.7. In short: an attacker positioned on the network path can get APT to install an attacker-controlled .deb package, even though it would fail signature verification, and that package's scripts run as root.

What you need before starting

  • Root or sudo access to each affected Debian or Ubuntu machine.
  • A note of which releases you run. Ubuntu 22.04 LTS (Jammy Jellyfish) and newer are affected by default. Older Ubuntu releases are only affected if Acquire::Retries is set to a non-zero value.
  • Debian stable (trixie) users need APT 3.0.4 or later.
  • Optional: a Ubuntu Pro subscription for older releases. Ubuntu says Pro is free for up to 5 machines, or up to 50 for community members, and covers Ubuntu 20.04 LTS and 18.04 LTS through Expanded Security Maintenance (ESM). Ubuntu 16.04 LTS and 14.04 LTS need ESM with the Legacy add-on.

No other tooling is needed. Nothing here costs money unless you are on an out-of-standard-support release.

Step-by-step process

Step 1: understand what makes you vulnerable (2 minutes)

Debian's advisory explains that APT can merge two different package downloads after an HTTP redirect gives them the same URI. Improper file handling when resuming an HTTP download then lets a man-in-the-middle attacker replace a package after verification. The attack depends on failed downloads being retried, which is governed by the Acquire::Retries setting. That setting has been on by default since APT 2.3.2, but many user scripts set it on older releases too.

The bug affects any frontend built on the APT library: apt, apt-get, aptitude and Ubuntu's graphical tools. FTP and other non-HTTP transports are not affected. Snap installs are not affected either.

Step 2: check your exposure (3 minutes)

Compare the installed APT package version against the fixed versions in the vendor advisories. On Debian trixie the target is 3.0.4. On Ubuntu, use the version table in Canonical's post for your release. Also look at your APT configuration for any Acquire::Retries line, including files under /etc/apt/apt.conf.d/, since an explicit non-zero value brings older Ubuntu releases into scope.

Step 3: apply a temporary mitigation if you cannot patch yet (2 minutes)

Add Acquire::Retries 0; to your apt.conf. Debian suggests this may mitigate the issue until you upgrade. Ubuntu says temporarily setting retries to zero while installing the security update mitigates the flaw, whether it is exploited by an on-path attacker or a potentially malicious mirror.

Alternatively, move your sources to HTTPS. Edit /etc/apt/sources.list and the files in /etc/apt/sources.list.d/ (either .sources or older .list format) and replace http:// with https:// for the Ubuntu archive. Then refresh the package lists and watch for errors, which appear if a mirror does not support HTTPS. Some community and country-specific mirrors do not.

Step 4: install the update (5 minutes)

Upgrade all packages, which Ubuntu recommends. If that is not possible, upgrade just the APT components. Debian's 3.0.4 release also fixes several out-of-bounds memory access issues, so it is worth taking even if you consider your network trusted.

Step 5: confirm and restore settings

Re-check the APT version, then remove the temporary Acquire::Retries 0; line if you added it and do not otherwise need it.

Common mistakes to avoid

  • Assuming signatures save you. Signature verification is APT's main defence, but this flaw lets an attacker get an unverified package installed. Ubuntu says the archive signature scheme remains the stronger protection, yet it does not help until the client is patched.
  • Blindly find-and-replacing HTTP URLs. Ubuntu's command only rewrites the Ubuntu archive; other mirrors and repositories are untouched, and some mirrors will fail over HTTPS. Run an update afterwards and read the output.
  • Treating "older release" as "safe". Older Ubuntu releases are exposed if anyone, or any script, set Acquire::Retries to non-zero.
  • Forgetting mirrors. A malicious mirror can exploit this too, which TLS does not address, so install the client update.

Tips that make a difference

  • Ubuntu's unattended-upgrades is enabled by default from 16.04 LTS onwards and applies security updates every 24 hours, so many machines will patch themselves. Verify rather than assume.
  • For fleets, Ubuntu points to Landscape, bundled with Ubuntu Pro, to control the rollout of security fixes.
  • Where an on-path attacker cannot be ruled out, enabling TLS before patching means there is no point at which an attacker could exploit the flaw over HTTP; afterwards TLS is a precaution.
  • Untrusted networks are the main risk: coffee-shop Wi-Fi, hotel networks and any path you do not control.

UK angle

For UK organisations, this is a routine but real patching obligation. IT teams working through compliance can use our UK cyber security compliance guide.

Next steps

Audit any scripts that set Acquire::Retries, move internal mirrors to HTTPS where they support it, and confirm unattended-upgrades is running across your estate. Keep a recent backup of important data too; the offsite backup guide for small businesses covers the basics.

You have now checked whether your systems are exposed, applied a temporary mitigation, and installed the fixed APT release, reducing the risk of an attacker getting from the network to root.

Frequently asked questions

Which versions fix CVE-2026-109518?

Debian stable (trixie) is fixed in APT version 3.0.4. Ubuntu has released security updates for all affected releases; compare your installed APT package version against the Ubuntu advisory.

Does HTTPS protect against CVE-2026-109518?

Yes. Exploitation needs an attacker to manipulate HTTP traffic, so HTTPS sources protect against it. Patching is still recommended, as is checking that your mirrors support HTTPS.

How do I mitigate CVE-2026-109518 without upgrading?

Set Acquire::Retries to 0 in apt.conf, which stops failed downloads being retried. Debian says this may mitigate the issue until you upgrade, and Ubuntu describes it as a mitigation while you install the update.

Are snap packages affected by the APT vulnerability?

No. Snaps use a different package management system, so installing software via snap is not affected by CVE-2026-109518.

More from Future Technology HQ