An on-path attacker capable of manipulating HTTP traffic, such as through a malicious mirror or proxy, can trick an APT client into installing an unverified, attacker-controlled package. This occurs because APT incorrectly handles hard links when encountering HTTP redirects and retrying package downloads, allowing a man-in-the-middle to replace a package after it has been cryptographically verified. Successful exploitation leads to remote code execution with root privileges via package installation scripts. This issue affects the HTTP backend used by `apt`, `apt-get`, and `aptitude`. Exploitation requires the client to follow redirects and have a non-zero `Acquire::Retries` configuration setting, which is the default for Debian 12 and Ubuntu 22.04 LTS and newer releases.