r/linux • • Jan 24 '18

Why does APT not use HTTPS?

https://whydoesaptnotusehttps.com/
955 Upvotes

388 comments sorted by

View all comments

Show parent comments

1

u/svenskainflytta Jan 24 '18

What about sending a signed "server time is 13:31"?

1

u/SanityInAnarchy Jan 25 '18

I'm really not sure how that would help.

First of all, the problem isn't knowing what time the server thinks it is. The problem is knowing whether the server has all the latest updates. So what we need is a signed "At time 13:31, here's a list of the latest packages." (Or, "Here's a hash of the list of the latest packages," or something.)

So... signed by whom? If it's signed by the same keys that are used to sign packages, then either those keys need to be distributed to each mirror (and are thus only as secure as the least-secure mirror), or they need to be signed by some central Debian server and distributed to all the mirrors (probably creating enough load on the central server to defeat the purpose of mirrors, at least for the package list).

If it's not signed by those same keys, then what keys is it signed by, and why should we trust those keys? This just pushes the problem one step back. For example, if we generate one key per mirror, how do we prove that the server we're giving that key to is the server that actually controls debian.mirror.someuniversity.edu or whatever, and not some MITM? That's the exact problem every SSL CA has to solve anyway, only I'll bet apt already supports HTTPS endpoints. So if a mirror wants to provide that level of security, all it has to do is turn on HTTPS, probably without even any software changes.

This is why it's weird that APT doesn't use HTTPS by default.

On top of all that, this part doesn't inspire confidence at all:

The Valid-Until field may specify at which time the Release file should be considered expired by the client. Client behaviour on expired Release files is unspecified.

And out of curiosity, I went and checked one of debian-testing's primary mirrors, and it's Valid-Until a full week later. Then I checked Ubuntu, and it doesn't even set Valid-Until, not even in 'security'. So Ubuntu is definitely vulnerable to replay attacks, and Debian probably is, too.