Online Mind Mapping and Brainstorming

Create your own awesome maps

Online Mind Mapping and Brainstorming

Even on the go

with our free apps for iPhone, iPad and Android

Get Started

Already have an account? Log In

Debian Crypto Incident May 2008 by Mind Map: Debian Crypto Incident
            May 2008
0.0 stars - reviews range from 0 to 5

Debian Crypto Incident May 2008

incident

who

Luciano Bello discovered that the random number generator in Debian's openssl package is predictable. This is caused by an incorrect Debian-specific change to the openssl package (CVE-2008-0166). As a result, cryptographic key material may be guessable.

what

when

where

why?

response

analysis

threat

comments

Remember patching isn't enough, you need to regenerate keys generated on these machines! Including those used in SSL certificates (X.509).

The greatest irony? All of these problems were caused by an attempt to make the software more secure two years ago.

cf. netscape

Really a Black Swan?

Author

Luke O'Connor

mind map used for this blog post

links

Debian wiki

# weak keys for both clients and servers (see section "Identifying Weak Keys below") # all key types that were generated using openssl (this includes RSA and DSA keys) # compromise of other keys or passwords that were transmitted over an encrypted link that was set up using weak keys. Note that this last point means that passwords transmitted over ssh to a server with a weak dsa server key could be compromised too; see the Debian project's reaction to this.

weakness in OpenSSL as used by Debian

many apps impacted, gives lots of detail on how to detect and rollover keys for various apps

CSR checker

how weak?, weak version only used PID as seed, 2^15-1 values, Non-broken OpenSSL seeds from PID and /dev/urandom.

detail, This was caused by an overzealous, well-intentioned elimination of code that was believed to have no impact on security. (Please do note from the above links that this was discussed with the !OpenSSL team and that no objections were raised at the time.), the code change, The second of these is in ssleay_rand_bytes where buf is used as an output buffer. It had already been marked as a bad idea when -DPURIFY was in effect, because Purify (and valgrind, naturally) dislike this use of an output buffer as input. This use of MD_Update is dubious but shouldn't hurt as long as the mixing function of the PRNG is "sufficiently good". The removal of this call to MD_Update should not meaningfully alter the entropy available in the pool -- that is, OpenSSL does not depend upon uninitialized memory for its correct operation. The first call, however, is in ssleay_rand_add where buf is used as an INPUT buffer, to add entropy to the pool. Failing to call MD_Update there means that the pool will never actually get the entropy intended for it.

debian project post

On May 13th, 2008

Luciano Bello discovered that the random number generator in Debian's openssl package is predictable. This is caused by an incorrect Debian-specific change to the openssl package (CVE-2008-0166). As a result, cryptographic key material may be guessable.

This is a Debian-specific vulnerability which does not affect other operating systems which are not based on Debian. However, other systems can be indirectly affected if weak keys are imported into them.

It is strongly recommended that all cryptographic key material which has been generated by OpenSSL versions starting with 0.9.8c-1 on Debian systems is recreated from scratch.

Affected keys include SSH keys, OpenVPN keys, DNSSEC keys, and key material for use in X.509 certificates and session keys used in SSL/TLS connections. Keys generated with GnuPG or GNUTLS are not affected, though.

metasploit

Removing this code has the side effect of crippling the seeding process for the OpenSSL PRNG. Instead of mixing in random data for the initial seed, the only "random" value that was used was the current process ID. On the Linux platform, the default maximum process ID is 32,768, resulting in a very small number of seed values being used for all PRNG operations.

All SSL and SSH keys generated on Debian-based systems (Ubuntu, Kubuntu, etc) between September 2006 and May 13th, 2008 may be affected.

lists other impacts as well

When creating a new OpenSSH key, there are only 32,767 possible outcomes for a given architecture, key size, and key type. The reason is that the only "random" data being used by the PRNG is the ID of the process.

heise security

Since a faulty patch in 2006, the OpenSSL library used by Linux distribution Debian has been generating weak cryptographic keys.

Security expert Luciano Bello has now discovered a critical vulnerability in the OpenSSL package which makes the random number sequences, and therefore keys generated, predictable.

The problem only affects Debian and distributions derived from it, such as Ubuntu and Knoppix.

OpenSSL provides connection security for many important network services, such as the Apache web server, the SSH login service, the OpenVPN service, the Bind name server, S/MIME e-mail encryption and the trustworthiness of digital signatures. This could enable attackers to listen in on and manipulate SSL connections, obtain unauthorised access to SSH servers or poison DNS server caches. Encryption systems such as PGP and GnuPG, which are not based on SSL or TLS, are not affected.

sec focus

A flaw in the way that OpenSSL is implemented in the Ubuntu and Debian distributions of Linux have earned the software an unenviable adjective in the world of encryption: Predictable.

SANS diary

But this is not all – keep in mind that ANY cryptographic material created on vulnerable systems can be compromised. If you generated SSL keys on such Debian or Ubuntu systems, you will have to recreate the certificates and get them signed again. An attacker can even decrypt old SSH sessions now.

Ben Laurie

The result of this is that for the last two years (from Debian’s “Etch” release until now), anyone doing pretty much any crypto on Debian (and hence Ubuntu) has been using easily guessable keys. This includes SSH keys, SSL keys and OpenVPN keys.

What can we learn from this? Firstly, vendors should not be fixing problems (or, really, anything) in open source packages by patching them locally - they should contribute their patches upstream to the package maintainers.

Had Debian done this in this case, we (the OpenSSL Team) would have fallen about laughing, and once we had got our breath back, told them what a terrible idea this was. But no, it seems that every vendor wants to “add value” by getting in between the user of the software and its author., breaking Linus' Law

Secondly, if you are going to fix bugs, then you should install this maxim of mine firmly in your head: never fix a bug you don’t understand. I’m not sure I’ve ever put that in writing before, but anyone who’s worked with me will have heard me say it multiple times.

Valgrind tracks the use of uninitialised memory. Usually it is bad to have any kind of dependency on uninitialised memory, but OpenSSL happens to include a rare case when its OK, or even a good idea: its randomness pool., 177 comments, rant

more aftermath, clarification, 55 comments

Emergent

ok commentary

DR

HD Moore record time exploit

These lines were removed because they caused the Valgrind and Purify tools to produce warnings about the use of uninitialized data in any code that was linked to OpenSSL.

Just goes to show you, no matter how great your tool set is, and I do like Valgrind, you have to understand how they work and more importantly how your code works., well you have to know what the programmer is thinking

No tool can be smart enough to tell you that the warning its complaining about with uninitialized data should be ignored (or at least fixed and not removed from the codebase) because it will effectively render the encryption you are trying to accomplish neutered.

Reg

One reader forwarded an excerpt from an internal discussion within the Debian Security Team that suggested the bug resides within OpenSSL itself and dates from May 2006. This pointed to possible flaws in OpenSSL 0.9.8b-1. However, the same source later told us, the flaw was later pinned down to OpenSSL 0.9.8c, as described in Debian's advisory. "They're still not revealing the full truth, particularly the fact the keyspace involved is only 215 possible permutations per architecture and thus very easily compromised if someone has a botnet at their disposal," our source said.

Reg 2

It's been more than a week since Debian patched a massive security hole in the library the operating system uses to create cryptographic keys for securing email, websites and administrative servers. Now the hard work begins, as legions of admins are saddled with the odious task of regenerating keys too numerous for anyone to estimate.

Certificates for defective keys will have to be revoked, new keys will have to be generated and, in the case of SSL certificates, registered with VeriSign or another certificate authority. No one knows how many keys need to be replaced, but it could number in the hundreds of thousands or millions. The keys are used for Secure Sockets Layer (SSL) transactions, which authenticate servers handling trusted websites and email, and to authenticate Secure Shell (SSH), which provides encrypted channels between sensitive computers.

The heft and tedium of tracking down, testing and regenerating so many keys, and the cost of paying certificate authorities to register them, has left some people feeling pessimistic about the prospects the problem will be fixed anytime soon., LT

"I can't imagine how painful this will be for people who are using large data centers with hundreds of certificates," Ellis said.

The Debian bug was introduced in September 2006. It vastly reduces the amount of entropy used when programs like the Apache webserver, Sendmail, Exim and some implementations of Kerberos use OpenSSL to perform basic cryptographic functions. As a result, attackers can crack SSL keys, x.509 certificate keys, SSH keys, and digital signatures in fewer than 33,000 guesses, rather than the seemingly-infinite number of tries that would normally be required.

Tools available from Ubuntu and Metasploit author HD Moore are designed to aid in the process of detecting weak keys, but Appelbaum, the independent researcher, says certain conditions will prevent even diligent searches from finding everything. For example, keys with nonstandard sizes may not be flagged even though they're vulnerable.

HS2

He believes that package maintainers should not play with source code they don't understand. Instead they should talk to the developers who can assess the patches and integrate them into the source code, effectively contributing their fixes upstream. According to Laurie, had Debian followed this policy, the OpenSSL problem would never have arisen.

Responsibility does not in this case lie exclusively with the maintainers of the Debian OpenSSL package. They were apparently fully aware that the change would result in a loss of randomness, for which reason they consulted the OpenSSL developers list to ensure that what they were doing was OK before introducing the fatal error into the package. No objections were registered, even after the event. Laurie backpedals somewhat in a subsequent blog entry and admits to communication problems within the OpenSSL team.

HS3

best discussion

last page

online test tool

SSL Guardian