3
$\begingroup$

I see a statement like this on a product's download page:
"The signature for setup-x86.exe can be used to verify the validity of this binary using this public key."

where each this above is a hyperlink.

I thought the purpose of a sig is so that you could verify the validity of a document.

So what's the purpose of such a statement?

Surely it can't be a protective measure just in case the site has been hacked to point the download link of the exe to a malicious file? In that case, won't the links to the signature/public-key themselves be altered by the attacker?

$\endgroup$
3
$\begingroup$

They don't expect that everybody uses their infrastructure. So, someone, a Man-in-the-Middle can change the executable or you are downloading it from alternative download sites that can contain malicious code.

One way to make sure that the file is not tempered is publishing the hashes on their website. Hash is very common for ISOs of the Linux distributions. This protects as long as you can access the hash values correctly. Another method is signing that also gives us information about the signer.

In the case of their website is hacked, you may be very unlucky to be in the middle of the attack that we expect it is a short time. If, however, they use a chained certificate and you know it before you can still check the signature. The attacker to be successful must somehow access the signature key. In general, to be on the safe side, the companies sign the files with an off-line computer so that the signature key cannot be accessed from an online attacker. As usual, the corresponding public key can be published.

So, in short, if the signature key does not belong to a trusted key chain that is verifiable, don't accept the file. Everybody can create a file with a signature and publish it with a verification key.

$\endgroup$
3
$\begingroup$

It is very common to download the binary from a source that is "closer" (in the network topology) to you, but use a "trusted" source (i.e. the vendor's web server) to obtain the signature / checksum.

That's why they are separate.

Now, your last question is valid:

in case the site has been hacked to point the download link of the exe to a malicious file? In that case, won't the links to the signature/public-key themselves be altered by the attacker?

Yes, if an attacker gains control of the content of the site, then she can replace both the binary and the signature. But, that is not what this kind of signature protects against. It is supposed to allow you to verify the binary if you get it from some other source than the official website. (It can also be used to guard against corruption of the download, of course.)

If you want to protect against the scenario in your question, then you need a way to obtain the signature via a separate trusted out-of-band channel.

E.g. in my university, the fingerprint of the master certificate and the PGP key were printed in the handout you received when you signed up for your university account, and were also printed in the copy of the student handbook and displayed at the computing center help desk as well as printed in the university newspaper.

$\endgroup$
1
  • $\begingroup$ Thanks for that really good explanation. Had to accept the answer by kelalaka unfortunately since it came first :) But what you mention about how it was handled at your Uni is interesting. $\endgroup$
    – Ash
    Jan 27 '19 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.