Security alert · High
APT flaw on Debian and Ubuntu lets MitM attackers swap packages and run code as root
· 3 minutes read · Centoculus Security Team
Known since
Affected: APT on Debian and Ubuntu (retries on by default from Debian 12)
What happened
On November 4, 2026, Debian and Ubuntu published advisories for a flaw in APT, the package manager used on both distributions. An attacker who can modify package downloads in transit (a man-in-the-middle position) can replace a package that APT has already verified with a different one. Because packages are installed with root privileges, this leads to code execution as root on the affected system.
The attack depends on APT's download retries. Retries are enabled by default starting with Debian 12. There are no reports of active exploitation at this time.
Who is affected
- Servers running Debian or Ubuntu where APT retries are enabled, which is the default from Debian 12 onward.
- Systems that download packages over a network path an attacker could tamper with, for example untrusted networks, shared hosting networks, compromised routers or proxies, or plain HTTP mirrors.
The exact affected and fixed APT versions are not included in our source data. Check the Debian and Ubuntu advisories via the reference linked below for the versions that apply to your release.
What to do now
- Look up the fixed APT version for your distribution and release in the Debian or Ubuntu security advisory.
- Install the update from a network path you trust, ideally over HTTPS mirrors or from inside your own trusted network:
sudo apt update sudo apt install --only-upgrade apt - Confirm the installed version matches the fixed version from the advisory:
apt --version dpkg -l apt - Until every server is updated, avoid running package installs or upgrades over untrusted networks. As a temporary measure you can disable APT retries, which the attack depends on, by creating
/etc/apt/apt.conf.d/99no-retrieswith the lineAcquire::Retries "0";. Remove it again once APT is patched if you rely on retries. - Prefer HTTPS mirrors in your sources lists (
/etc/apt/sources.listand/etc/apt/sources.list.d/) where your mirror supports it. - Roll the update out to all Debian and Ubuntu servers, containers and base images you maintain, including automation such as unattended-upgrades and image builds.
How to check whether you are affected
- Compare the output of
dpkg -l aptwith the fixed version listed in the advisory for your release. If your version is older, the server is affected. - Check whether retries are configured:
apt-config dump | grep -i retries. On Debian 12 and later they are on by default even if no explicit setting appears. - Review recent package activity for installs or upgrades you do not recognise:
/var/log/apt/history.logand/var/log/apt/term.log, and/var/log/dpkg.log. - If a server installed packages over an untrusted network before it was patched and you see unexpected activity, treat it as potentially compromised: look for unknown users, cron jobs, systemd units and SSH keys, and consider rebuilding it from a known good state. Note that tools like
dpkg --verifycompare files against the installed package's own checksums and will not reveal a package that was swapped as a whole.
Sources
Related posts
Alerts ·
OpenSSH on Alpine Linux: login without password via overlong passwords
On Alpine Linux servers with the standard openssh-server package, attackers can log in to accounts without a password, such as key-only accounts. OpenSSH 10.6p2 and updated Alpine packages fix it.
Alerts ·
Ruby on Rails Active Storage: critical file write flaw via ImageMagick uploads
A critical flaw in Ruby on Rails Active Storage lets unauthenticated attackers write arbitrary files on the server through a crafted upload when ImageMagick processes it. Update to Rails 8.1.4.1 or 8.0.5.2.
Alerts ·
Xen hypervisor flaws let a malicious guest read and write other VMs' memory
Two newly disclosed Xen flaws let a malicious guest access the memory of other VMs, including dom0. All versions since 4.6 are affected and there is no mitigation, so hosts need to be patched.