A failure by many IoT device manufacturers to follow cryptographic best practices is leaving a high proportion of the devices vulnerable to attack, researchers warn.
Researchers at Keyfactor recently collected some 175 million RSA certificates and keys from the Internet using a proprietary SSL/TLS certificate discovery process and then analyzed the data using a particular mathematical method.
The analysis showed that roughly 435,000 of the RSA certificates analyzed—or roughly 1 in every 172 active certificate—were vulnerable to compromise or attack. A high percentage of the weak certificates belonged to routers, modems, firewalls, and other network devices. Other potentially impacted devices included cars and medical implants.
The problem, according to Keyfactor is the insufficient entropy—or randomness—that is used in generating encryption keys on these devices.
RSA keys enable encrypted communication on the Internet. An RSA key is basically the product of two equally large and random prime numbers, both of which are private. “The security of RSA relies on the inability of another party to determine [the] two randomly chosen prime numbers from which the RSA public key is derived,” Keyfactor researcher Jonathan Kilgallin said in a technical paper presented last week at an IEEE conference on trust and privacy in Los Angeles.
Normally, no two RSA keys should share the same prime factors. But Keyfactor’s research showed about 435,000 certificates had a shared prime factor. This made it relatively easier to apply mathematical techniques to try and derive—or to factor—the entire original RSA key. All it took Keyfactor researchers to crack about 250,000 of the vulnerable certificates was a single virtual machine on Microsoft Azure and an algorithm for detecting shared factors. The total setup cost about $3,000, according to the company.
In contrast, Keyfactor found that only 5 in 100 million certificates signed and issued by trusted certificate authorities—and listed in the publicly accessible Certificate Transparency logs—could be similarly compromised.
A majority of the weak certificates belong to Internet-connected devices such as routers and modems with limited resources on them in terms of processing power, memory, and entropy says Ted Shorter, chief technology officer and co-founder at Keyfactor. “If you ask an IoT device to generate a random number, the result is not always as random as it should be,” Shorter says. “So you get weak keys,” that can be cracked relatively easily.
A Lack of Randomness
A threat actor that is able to derive the private key for an SSL/TLS server certificate can impersonate that device, he says. “If you have the private key, you can pose as the device or endpoint that was compromised,” and intercept any communications to that device, Shorter says. In certain settings—such as within a hospital or with a device installed in an automobile—the consequences of an attacker impersonating a trusted device can be especially dangerous, he says. An attacker could also decrypt any data that might have been encrypted with the compromised key.
Designers of IoT devices need to pay closer attention to the encryption available on their devices. They need to be thinking about how to add entropy to the process so that RSA keys are derived from truly random prime numbers, he says. Meanwhile, customers of IoT devices, especially those in critical sectors, need to ask their vendors about the secure random-number generation capabilities on the devices, Shorter says.
The news should be worrisome, especially to anyone using an IoT-device generated SSL certificate to authenticate connections across untrusted networks, says Craig Young, security researcher at Tripwire.
Young says a quick search of Censys.io—a service for searching for Internet connected devices—shows there are some 124 million self-signed certificates out of about 2.2 billion indexed certificates. Many of these certificates are clearly from devices like cable modems or enterprise wireless access point controllers. “The certificates would commonly be generated on device meaning they are constrained in terms of entropy sources,” Young says.
Worrisome as the threat is, real-world attacks, especially targeted ones, against impacted systems are unlikely, he says. In order to exploit this for a targeted attack, “an attacker must first be lucky enough to find a factor for the key on a targeted system as well as being in a privileged network position to exploit this,” Young says.
Assuming that anyone is in position to collect the necessary data, the actual attack will require the hacker to have enough access to manipulate the data stream. “An individual could do this by spoofing WiFi or even cell tower signals,” but the payout would not seem commiserate with the required work, he says. “In my opinion, if anyone is going to use something like this in the real-world, it would be a signals intelligence outfit working at the behest of a nation.”
Jai Vijayan is a seasoned technology reporter with over 20 years of experience in IT trade journalism. He was most recently a Senior Editor at Computerworld, where he covered information security and data privacy issues for the publication. Over the course of his 20-year … View Full Bio