If some attackers compromised an ISO image of Ubuntu and replaced inner PGP keys , then I will not to able get & install security updates. Is it right?

I'm asking it because I possible may meet the compromised OS and I heard that Ubuntu updates are PGP signed.


Attack Vectors

The Ubuntu installer brings (equally to pretty much all other Linux distributions) a set of OpenPGP keys trusted by the package manager.

Given you download/get hold of a tampered ISO image, different things might happen based on what was changed.

  • If the OpenPGP keys have been changed, you might either not be able to install updates any more (if the original ones have been dropped), and/or software from actually untrusted sources is trusted (when keys are added).
  • If apt's sources.list file was modified, one could also redirect to a location providing malicious updates (and signed with "trusted" keys, if these have been added, altough not Ubuntu's ones).
  • An attacker could have changed pretty much everything, including the actual verification of OpenPGP signatures or include arbitrary malware and backdoors. If the checksums are different, you don't know anything any more about the ISO image, and you couldn't reasonably verify what's wrong (but against another, untampered image).

To be sure about receiving a valid ISO image actually issued by Canonical, check against the SHA256 checksums provided on the download page, and if you have a trust path to Canonical's signing key, also verify the OpenPGP signature of that file.

When ISO Image Checksums are Valid

If you make sure you have a trusted ISO image from the start, then everything's fine. If you're scared of man-in-the-middle-attacks while downloading from Canonical (like a three letter agency shipping a tampered file to you, and also modifying the checksum file), fetch the checksum file using different internet lines, to be very sure possibly even from public computers (they can't and/or wouldn't tamper it for everybody, as this likely would've been noticed by somebody).

SHA256 is believed to be secure, if the checksum is right, everything's fine and nobody can either hide updates nor send you any malicious ones, as the whole package management chain is secured. The only thing they could do is a kind of denial of service attack, but you would realize that (as an error message would be printed).

  • It's worth noting that setting up a fake repository and building a complete set of packages signed by the fake key would take a fair amount of work, and you have to do it without any pesky security researchers noticing. It's totally possible, but it's important to keep the threat model in mind. For example, if OP represents the government of Argentina, say, maybe someone like Brazil is trying to NSA them. But it's not worth Brazilian SIGINT's time to go after J Random User. No reason not to check signatures, just balance paranoia with common sense. – user3113723 Apr 16 '15 at 22:14
  • Thanks for great useful answer. Im asking about this, because Im aware of replaced software what I will download from official repositories to check the identity of the image (hash of it). Thats the case. So as I understood there is no way to get compromised software from repo's even if rest of OS image is compromised. – Argentina888 Apr 17 '15 at 6:22
  • I could the checksum, but I'm aware of software that will be checking hash will be compromised too by replacement of software on repo's This thing about sources.list makes me nervous. Thats the whole problem. – Argentina888 Apr 17 '15 at 6:24
  • Instead of replying in the comments, I extended my answer regarding your fears. In a few words: if checksums are wrong, everything might be wrong, don't use the image. If they're fine, you're safe. Look at the revision page to see what I've added. – Jens Erat Apr 17 '15 at 7:13

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.