News for hackers. Stuff that matters.
Re:Debian apt security update (man-in-the-middle) by SoftTalker on Wednesday November 04, 2026 @11:39AM (#50368123)
So apt doesn't verify signatures on what is actually downloaded?
Re:Debian apt security update (man-in-the-middle) by dinosaurdynasty on Wednesday November 04, 2026 @11:48AM (#50368257)
> Improper file handling when resuming an HTTP download allows a man-in-the-middle attacker to replace a package after verification

from the OP

APT can use HTTPS, but often doesn't, making a MITM attack easier (also the idea for a long time has been signatures are enough, and/or TLS certs used to be a lot harder to get, but at this point you should really be using both).

Re:Debian apt security update (man-in-the-middle) by SoftTalker on Wednesday November 04, 2026 @12:10PM (#50368544)
Still doesn't make sense to me. So package A is downloaded, signature verified, then package B is downloaded, but somehow the package A file is replaced? Is it something like that?
Re:Debian apt security update (man-in-the-middle) by tosti on Wednesday November 04, 2026 @01:08PM (#50369307)
The somehow is package B has the same filename as package A.
Re:Debian apt security update (man-in-the-middle) by xeyownt on Wednesday November 04, 2026 @03:03PM (#50370751)
The bug is not trivial, I asked my AI friend to analyze.

To summarize, APT may have several download sessions in parallel, which may download the same "resources". To save bandwidth, disk storage, these same resources are downloaded only one, but given different names on the disk through hard links.

Because of HTTP retry, APT may be lured into downloading again a resource, but that was associated with a different package name, package that was already checked (hash verified). This is because of some differences between the package name / filename / URI, etc.

Anyway, the point is that hash are verified when a package is completed, but because of possible parallel downloads and hard links usage, a verified package can be rewritten.

What I find crazy though is that why packages are not first completely all downloaded, then every time a package is used, the hash be verified before being used. This would reduce even further the surface of attacks, and I don't care about any performance impact.

Re:Debian apt security update (man-in-the-middle) by SoftTalker on Thursday November 05, 2026 @11:34AM (#50381189)
> What I find crazy though is that why packages are not first completely all downloaded, then every time a package is used, the hash be verified before being used. This would reduce even further the surface of attacks, and I don't care about any performance impact.

Yes I'm amazed to learn this is not the case. Without that, any local exploit that could replace a file could potentially replace a downloaded, "already verified" package.

Re:Debian apt security update (man-in-the-middle) by mikepurvis on Monday November 09, 2026 @04:32PM (#50432505)
If you can replace a local file that's owned and writable only by root, then it's already game over anyway.
Re:Debian apt security update (man-in-the-middle) by thayne on Wednesday November 04, 2026 @12:45PM (#50369003)
Https doesn't help with this if the MitM is the apt mirror you are using.

One reason http is still used is because you need an independent signature anyway since it is common to use mirrors that don't have the same level of trust as the debian maintainers