Changes between Initial Version and Version 1 of DebianOpenSslBug


Ignore:
Timestamp:
05/22/2008 01:09:41 PM (16 years ago)
Author:
Brian Warner
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DebianOpenSslBug

    v1 v1  
     1
     2= Debian OpenSSL Bugs and Foolscap =
     3
     4As you've probably heard, last week (13 May 2008) the debian project
     5published a security advisory that described how the openssl package has been
     6using a 17-bit random number generator for the last two years. As a result,
     7keys and certificates generated by the affected versions (or used for DSA
     8signatures by affected versions) should be considered compromised and
     9immediately replaced. This affects the last 3 or 4 Ubuntu releases too
     10(Dapper was correct, Edgy was broken). All affected releases now have fixed
     11versions available for download, and obviously everyone using an affected
     12release needs to upgrade immediately.
     13
     14 http://lists.debian.org/debian-security-announce/2008/msg00152.html
     15
     16Since the bug affected key generation, keys which were created by the broken
     17versions will remain broken even after openssl itself is upgraded. The Debian
     18and Ubuntu projects have released tools to detect weak ssh keys that were
     19generated by these versions and disable them. Other projects (including
     20Foolscap) use generated keys for various purposes, so the effects of this bug
     21will linger even after openssl has been fixed.
     22
     23How does this affect Foolscap? The short answer: Weak keys generated by the
     24broken versions of openssl will enable a man-in-the-middle attack, which (if
     25successful) would reveal the private swissnums that protect access to
     26Referenceables. Foolscap users who have created Tubs while they had the
     27broken versions installed should stop using the associated FURLs and generate
     28new certificates/FURLs.
     29
     30The longer answer: There are three things in Foolscap that use random
     31numbers:
     32
     33 1. TubIDs [COMPROMISED]. These are a hash of the public key that corresponds
     34 to a Tub's private key, and are included in FURLs (as the base32 part
     35 immediately following the pb:// prefix). This provides protection against a
     36 man-in-the-middle attack: when connecting to a FURL, the certificate of the
     37 remote end is compared against the TubID in the FURL, and the connection is
     38 dropped with extreme prejudice if they do not match. This validation is
     39 performed before any secrets are passed over the wire.
     40
     41
     42 2. SwissNums [SAFE]. These are a randomly-generated name for a reference,
     43 created when tub.registerReference(obj) is called without a name= argument,
     44 and when a Referenceable is sent over the wire without being explicitly
     45 registered. They appear at the right-hand end of the FURL, after the last
     46 slash. Most Referenceables are given these unguessable names, because that
     47 limits access to parties that have been explicitly granted access. (when
     48 registerReference() is called with a guessable name, anyone who can guess
     49 that name will get reference to the given object). The capability-based
     50 security of foolscap Referenceables depends upon these swissnums remaining
     51 secret.
     52
     53 3. SSL transport sessions [VULNERABLE]. Foolscap runs over SSL, which uses
     54 random numbers to generate the Diffie-Hellman key agreement parameters. An
     55 eavesdropper who can guess one of these parameters will be able to determine
     56 the session key, and can decrypt the remainder of the conversation.
     57
     58TubIDs are derived from an SSL certificate that OpenSSL generates on demand,
     59and if the broken version of OpenSSL was used for this purpose, than that
     60certificate will be guessable. (at some point it would be great to write a
     61tool that would generate the 128000-ish TubIDs that can be generated by the
     62broken SSL, to create a blacklist like the ones created by debian/ubuntu for
     63ssh keys).
     64
     65So if you've generated a TubID with the broken version of openssl, it is
     66pretty easy to guess the corresponding private key. This allows an attacker
     67to mount an undetectable man-in-the-middle attack: if they can convince you
     68to make your TCP connection to their server instead of the right one, then
     69they can impersonate the real server, and they'll get to see the unencrypted
     70conversation (revealing the private swissnums).
     71
     72Swissnums are generated by calling os.urandom(), which was not affected by
     73the openssl bug. As long as one of the other problems (man-in-the-middle
     74attack) doesn't reveal your swissnums to an attacker, access to
     75Referenceables will remain limited to the parties to whom you've explicitly
     76granted it (by telling them the swissnum, in a FURL).
     77
     78Foolscap uses SSL for its encrypted transport, and SSL frequently uses
     79Diffie-Hellman key negotiation to establish a session key. This key
     80negotiation process depends upon random numbers, generated by the same buggy
     81RNG that is used to create keys. So if one of the two ends of an encrypted
     82session was using the buggy version of openssl, then an attacker may be able
     83to guess the session key, and thus decrypt the conversation. (note, I'm not a
     84cryptographer, and I'm not as confident about this attack as I am about the
     85others). So like the MitM attack, it seems likely that swissnums used by
     86sessions established during the buggy openssl era may be compromised: an
     87eavesdropper who recorded that encrypted conversation may be able to decrypt
     88it after the fact.
     89
     90
     91Of course, the whole idea of capabilities is to implement the Principle Of
     92Least Authority: each FURL gives access to a specific Referenceable that will
     93only do some specific limited task. If an MitM/eavesdropper manages to guess
     94your supposedly-unguessable swissnums, they'll still only be able to do
     95whatever the Referenceable will let them do.
     96
     97
     98So to summarize: if you've been using the buggy openssl libraries, here's
     99what you need to do:
     100
     101 1. upgrade openssl
     102 1. throw out your old FURLs (tell everyone that you've given them to to stop
     103    using them): this protects clients from the MitM attack.
     104 1. throw out your old Tub certificates: the certFile= argument to Tub()
     105    provides a persistent location for this.. just delete that file. This
     106    prevents clients from ever successfully using the old FURLs to connect
     107    to your server.
     108 1. restart the Tub, allowing it to create a new certificate
     109 1. regenerate and distribute new FURLs
     110
     111You can also just upgrade openssl (and keep using your old certs and FURLs)
     112if you're willing to remain vulnerable to man-in-the-middle attacks or
     113eavesdroppers who have recorded your earlier conversations.