I’ve noticed that some organisations, particularly Microsoft, have been releasing security updates where the download URL contains some form of checksum for the file. Here’s an example, which is the download for this security vulnerability in Windows 2000.
The page doesn’t explain which algorithm they use to generate the hash. It’s a 128-bit value, but it’s not straight MD5 (wrong values), or SHA1 (wrong length). It also doesn’t say why it’s there, or give you any way to use that information to verify the download, so I assume it’s designed for automated tools like Windows Update or similar. If anyone has more info, please comment. [Update: apparently, it’s just a GUID – basically a random number. So all the stuff below is my invention rather than being copied from anyone else.]
This is a great idea in principle, because it means that no-one can break into the server and trojan the file – if they do, then the checksum doesn’t match any more. And if they change the name of the directory it’s in to match the new checksum, all the published links break and users still don’t get the trojaned file. But it’s no use if the checksum isn’t checked.
So I started thinking. It must be fairly common that users download files where they are given the URL by a trusted source – or, at least, get it from another location or server which would also have to be compromised.
So what’s to stop any user agent verifying a downloaded file against its path-based checksum, or ‘Link Fingerprint’? It would work like this: if the user agent downloaded a file whose URL had a path component matching a particular pattern (perhaps /md5[0-9a-zA-Z]{16}/), the user agent would checksum the file, compare it to the URL, and put up a nasty scary “don’t trust this file” warning if they were different. I’m assuming it’s fairly unlikely that many files will have paths like that where the relevant path component isn’t an md5sum.
Yes, files may be digitally signed with the distributing company’s key, as most Linux distributions do with their RPMs, but verifying that often involves a lot of PKI hassle which is currently out of the reach of many users. The idea of this would be a simple way for a software distributor to reduce the likelihood of their download being successfully trojaned, with no need for the user to be made to perform verification steps.
There are implementation details, of course – you’d need to watch out for redirects, for a start – but is the basic idea useful, or are there too many potential problems with it? Or perhaps it’s solving an issue that isn’t a problem in practice?