Security Experts:

Connect with us

Hi, what are you looking for?



Predictable SSH Host Key Flaw Affects Raspberry Pi Devices

Some Raspberry Pi devices are affected by a security issue stemming from the Raspbian operating system generating weak and predictable SSH keys.

Some Raspberry Pi devices are affected by a security issue stemming from the Raspbian operating system generating weak and predictable SSH keys.

In a post on the Raspberry Pi forums, developer “oittaa” revealed that the hardware random number generator was not enabled in Raspbian by default, which automatically resulted in predictable SSH host keys being generated on the first boot. He also suggested that the issue would reside in the system not being able to seed /dev/urandom before generating SSH keys.

“Raspbian doesn’t enable hardware random number generator by default. This causes generation of predictable SSH host keys on the first boot. As soon as the systems starts up systemd-random-seed tries to seed /dev/urandom, but /var/lib/systemd/random-seed is missing, because it hasn’t been created yet. /etc/rc2.d/S01regenerate_ssh_host_keys is executed, but /dev/urandom pool doesn’t have that much entropy at this point and predictable SSH host keys will be created,” he said.

Based on Debian, the free platform optimized for Raspberry Pi called Raspbian takes advantage of the /dev/urandom function for generating random numbers, the same as Linux does. The function should not depend on the user entropy data, thus making it more popular compared to /dev/random, which generates better random numbers based on user-generated entropy.

Apparently, the /dev/urandom function in Raspbian does not have enough entropy data to work with because the platform tries to generate SSH host keys at boot, and the sequence fails. The operating system generates predictable values, making the SSH keys less secure than they would be should enough entropy data be available.

However, it seems that the Raspbian developers are aware of the entropy issue and are already looking into it, with plans to patch it soon, most probably in the next image, one forum moderator said. Given that the security flaw is being analyzed internally, additional details on the matter are not likely to be provided soon.

To ensure that their devices are kept secure, the owners of Raspberry Pi’s running on Raspbian are advised to update them as soon as a new image is available, which should include a patch for this issue.

As David Holmes, evangelist for F5 Networks’ security solutions, explained in a SecurityWeek column earlier this year, entropy is a must for cryptography because keys are generated from random data. However, he also explains that making up random data to have entropy for system’s random number generator (RNG) is not a good idea either, as the stream can be determined if the initial seed values can be guessed.

Holmes also cited a 2009 research paper according to which “between 1 and 2 percent of all SSL keys on the Internet are factorable (and therefore recoverable), largely due to bad entropy. In 2008, a screw-up in the RNG of one of the Debian distributions resulted in only 15 bits of entropy in their keys. This key generation weakness went unnoticed for years.” He also added that “the problem is going to keep happening.”


Written By

Click to comment

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Expert Insights

Related Content

Cloud Security

VMware vRealize Log Insight vulnerability allows an unauthenticated attacker to take full control of a target system.

IoT Security

Lexmark warns of a remote code execution (RCE) vulnerability impacting over 120 printer models, for which PoC code has been published.

Mobile & Wireless

Apple rolled out iOS 16.3 and macOS Ventura 13.2 to cover serious security vulnerabilities.

Email Security

Microsoft is urging customers to install the latest Exchange Server updates and harden their environments to prevent malicious attacks.

Application Security

Drupal released updates that resolve four vulnerabilities in Drupal core and three plugins.

Mobile & Wireless

Technical details published for an Arm Mali GPU flaw leading to arbitrary kernel code execution and root on Pixel 6.


Less than a week after announcing that it would suspended service indefinitely due to a conflict with an (at the time) unnamed security researcher...

Application Security

A CSRF vulnerability in the source control management (SCM) service Kudu could be exploited to achieve remote code execution in multiple Azure services.