So how did the programmers make the mistake in the first place?Ironically, they were using an automated tool designed to catch thekinds of programming bugs that lead to security vulnerabilities. Thetool, called Valgrind ,discovered that the OpenSSL library was using a block of memory withoutinitializing the memory to a known state--for example, setting theblock's contents to be all zeros. Normally, it's a mistake to usememory without setting it to a known value. But in this case, thatunknown state was being intentionally used by the OpenSSL library tohelp generate randomness.
The uninitialized memory wasn't the only source of randomness:OpenSSL also gets randomness from sources like mouse movements,keystroke timings, the arrival of packets at the network interface, andeven microvariations in the speed of the computer's hard disk. But whenthe programmers saw the errors generated by Valgrind, they commentedout the offending lines--and removed all the sources of randomness usedto generate keys except for one, an integer called the process ID thatcan range from 0 to 32,767.
"Never fix a bug you don't understand!" raved OpenSSL developer Ben Laurie on his blogafter the full extent of the error became known. Laurie blames theDebian developers for trying to fix the "bug" in the version of OpenSSLdistributed with the Debian and Ubuntu operating systems, rather thansending the fix to the OpenSSL developers. "Had Debian done this inthis case," he wrote, "we (the OpenSSL Team) would have fallen aboutlaughing, and once we had got our breath back, told them what aterrible idea this was. But no, it seems that every vendor wants to'add value' by getting in between the user of the software and itsauthor."
Perhaps more disconcerting, though, is what this story tells usabout the security of open-source software--and perhaps about thesecurity of software in general. One developer (who I've been asked notto single out) noticed a problem, proposed a fix, and got the fixapproved by a small number of people who didn't really understand theimplications of what was being suggested. The result: communicationsthat should have been cryptographically protected between millions ofcomputer systems all over the world weren't really protected at all.Two years ago, Steve Gibson, a highly respected security consultant,alleged that a significant bug found in some Microsoft software had more in common with a programmer trying to create an intentional "back door" than with yet another Microsoft coding error.
The Debian OpenSSL randomness error was almost certainly an innocentmistake. But what if a country like China or Russia wanted tointentionally introduce secret vulnerabilities into our open-sourcesoftware? Well concealed, such vulnerabilities might lay hidden foryears.
One thing is for sure: we should expect to discover more of these vulnerabilities as time goes on.
Simson Garfinkel is an associate professor at the navalpostgraduate school in Monterey, CA, and a fellow at the Center forResearch and Computation and Society at Harvard University.
