Detecting and replacing weak Debian OpenSSL keys

Summary

In May 2008, at readers' request, Manuel Schmitt publishes manitu's customer warning about the Debian OpenSSL bug that let attackers guess keys generated on Debian, Ubuntu and Knoppix. Mainly SSH keys and web server certificates are affected; the mail points to the Debian security advisory, the key rollover guide and the testing tools vulnkey and dowkd.pl. An addendum makes clear that users of other distributions are affected too if their keys were created on a vulnerable system.

What went wrong at Debian

The Debian security advisory DSA-1571 of 13 May 2008 names Luciano Bello as the discoverer and the bug as CVE-2008-0166. A Debian-specific change made the random number generator predictable; the first vulnerable version 0.9.8c-1 reached unstable on 17 September 2006 and from there etch.

According to the Debian wiki, the maintainer wanted to get rid of warnings from the memory checker Valgrind about uninitialised memory and commented out two lines in md_rand.c to do so. Afterwards only the process ID seeded the generator. Because the output depended on architecture and process ID, there were only 32,767 possible random streams per architecture.

What was affected

DSA-1571 lists SSH, OpenVPN and DNSSEC keys as well as key material for X.509 certificates and TLS sessions. Keys generated with GnuPG or GnuTLS were not affected. All DSA keys ever used for signing on an affected system are considered compromised, because DSA needs a secret random value for every signature.

Ideas

  • A faulty distribution can weaken the keys of many dependent applications at once.
  • A software update does not repair keys already generated with low entropy.
  • Other systems remain affected if they take over keys from a vulnerable Debian system.
  • Few possible random streams make every key computable in advance.
  • DSA keys were compromised merely by signing on an affected system.
  • Customer communication must clearly separate exposure, limits and concrete checks.

Insights

  • A key's cryptographic origin follows it across operating system boundaries.
  • A change meant only to silence tool warnings can destroy security properties.
  • Supply chain flaws in random number generation require an inventory and complete key rotation.

Facts

  • DSA-1571 was published on 13 May 2008 and tracks the bug as CVE-2008-0166.
  • The first vulnerable version 0.9.8c-1 was uploaded on 17 September 2006.
  • The broken generator was seeded only with the process ID, giving 32,767 possible streams per architecture.
  • Keys generated with GnuPG or GnuTLS were not affected.
  • The previous stable release Sarge was not affected.

References

Recommendations

  • Check all keys generated during the affected period against known weak key lists.
  • Generate replacements on a safe system and revoke old certificates and access.
  • Replace DSA keys that ever signed on an affected system, even if they were created elsewhere.

Read the original article on Hostblogger

Search the Web Archive

Found a mistake or have something to add? Get in touch.