Feeds

LibreSSL RNG bug fix: What's all the forking fuss about, ask devs

Blow to bit-spitter 'tis but a flesh wound, claim team

Protecting users from Firesheep and other Sidejacking attacks with SSL

A bug found and fixed in LibreSSL, the OpenSSL fork maintained by OpenBSD developers, is “catastrophic" or "overblown", depending on whom you talk to.

Just days after the release of a portable version of the crypto library, a flaw was reported in LibreSSL's pseudo-random number generator – its PRNG, a vital component in strong encryption.‬

Andrew Ayer was able to write a program that could call LibreSSL's PRNG twice and get back the exact same stream of bits each time, which is not supposed to happen. Ayer, the founder of secure backup company Opsmate, described this bug as a “catastrophic failure of the PRNG.”

The OpenBSD project rejected this assessment as "overblown", and instead said the glitch was "minor". Nonetheless, the team promptly addressed the problem in LibreSSL version 2.0.2 and released it.

OpenBSD contributor Bob Beck reckoned a "contrived test program", such as the one produced by Ayer, was needed to reproduce the bug.

“While it’s a real issue, it’s actually a fairly minor one, because real applications don’t work the way the author describes, both because the PID (process identification number) issue would be very difficult to have become a real issue in real software, and nobody writes real software with OpenSSL the way the author has set this test up in the article,” Beck told Kaspersky Labs' Threatpost news service.

Ayer's fork_rand proof-of-concept code exploited the fact that fork()ing a program linked with LibreSSL produces a child process with the same PRNG state as the parent – meaning they will both spit out the same sequence of pseudo-random numbers.

This is not particularly brilliant because it means, for example, one process knows what another's random bit stream will look like, and these bit streams are used to generate secure encryption keys. Secrets will be leaked, in other words.

LibreSSL tries to detect when it is running in a fork()ed process by checking its process ID (PID): a change in PID means it is running in a new child, and duly resets its PRNG state to produce different numbers.

But the PID on Linux is 16 bits wide by default, and overflows when it hits that limit. If a program fork()s hard enough, a child could end up reusing a grandparent's PID and the aforementioned reseed check fails.

"You may think that fork_rand is a contrived example or that it's unlikely in practice for a process to end up with the same PID as its grandparent," wrote Ayer on his blog.

"You may be right, but for security-critical code this is not a strong enough guarantee. Attackers often find extremely creative ways to manufacture scenarios favorable for attacks, even when those scenarios are unlikely to occur under normal circumstances."

Bugs in PRNG components are a big deal because they weaken cryptographic systems. The NSA-championed Dual EC DRBG PRNG, which was offered as a default in the RSA BSAFE cryptography library, was found to be hopelessly flawed – so much so, it's believed Uncle Sam's spies deliberately knackered it with a backdoor.

LibreSSL forked from the OpenSSL cryptographic software library in April 2014 following the discovery of the password-leaking Heartbleed bug in OpenSSL; the vulnerability was severe enough that the OpenBSD gang decided to overhaul the crucial library, used in countless computers and devices for encryption and decryption.

Despite remaining critical of the way LibreSSL developers handled his bug report, Ayer remains broadly supportive of the project. "I really appreciate the work the LibreSSL devs are doing, especially their willingness to solicit feedback from the community and act on it," he said.

The fix, by the way, is to trap calls to fork() and act accordingly, rather than sense a PID change, but it may not be a perfect solution. ®

The next step in data security

More from The Register

next story
Israeli spies rebel over mass-snooping on innocent Palestinians
'Disciplinary treatment will be sharp and clear' vow spy-chiefs
Infosec geniuses hack a Canon PRINTER and install DOOM
Internet of Stuff securo-cockups strike yet again
THREE QUARTERS of Android mobes open to web page spy bug
Metasploit module gobbles KitKat SOP slop
'Speargun' program is fantasy, says cable operator
We just might notice if you cut our cables
Apple Pay is a tidy payday for Apple with 0.15% cut, sources say
Cupertino slurps 15 cents from every $100 purchase
YouTube, Amazon and Yahoo! caught in malvertising mess
Cisco says 'Kyle and Stan' attack is spreading through compromised ad networks
Hackers pop Brazil newspaper to root home routers
Step One: try default passwords. Step Two: Repeat Step One until success
Greater dev access to iOS 8 will put us AT RISK from HACKERS
Knocking holes in Apple's walled garden could backfire, says securo-chap
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
Saudi Petroleum chooses Tegile storage solution
A storage solution that addresses company growth and performance for business-critical applications of caseware archive and search along with other key operational systems.
Security and trust: The backbone of doing business over the internet
Explores the current state of website security and the contributions Symantec is making to help organizations protect critical data and build trust with customers.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.