Fixing the IoT isn't going to be easy
Oct. 21st, 2016 11:35 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
A large part of the internet became inaccessible today after a botnet made up of IP cameras and digital video recorders was used to DoS a major DNS provider. This highlighted a bunch of things including how maybe having all your DNS handled by a single provider is not the best of plans, but in the long run there's no real amount of diversification that can fix this - malicious actors have control of a sufficiently large number of hosts that they could easily take out multiple providers simultaneously.
To fix this properly we need to get rid of the compromised systems. The question is how. Many of these devices are sold by resellers who have no resources to handle any kind of recall. The manufacturer may not have any kind of legal presence in many of the countries where their products are sold. There's no way anybody can compel a recall, and even if they could it probably wouldn't help. If I've paid a contractor to install a security camera in my office, and if I get a notification that my camera is being used to take down Twitter, what do I do? Pay someone to come and take the camera down again, wait for a fixed one and pay to get that put up? That's probably not going to happen. As long as the device carries on working, many users are going to ignore any voluntary request.
We're left with more aggressive remedies. If ISPs threaten to cut off customers who host compromised devices, we might get somewhere. But, inevitably, a number of small businesses and unskilled users will get cut off. Probably a large number. The economic damage is still going to be significant. And it doesn't necessarily help that much - if the US were to compel ISPs to do this, but nobody else did, public outcry would be massive, the botnet would not be much smaller and the attacks would continue. Do we start cutting off countries that fail to police their internet?
Ok, so maybe we just chalk this one up as a loss and have everyone build out enough infrastructure that we're able to withstand attacks from this botnet and take steps to ensure that nobody is ever able to build a bigger one. To do that, we'd need to ensure that all IoT devices are secure, all the time. So, uh, how do we do that?
These devices had trivial vulnerabilities in the form of hardcoded passwords and open telnet. It wouldn't take terribly strong skills to identify this at import time and block a shipment, so the "obvious" answer is to set up forces in customs who do a security analysis of each device. We'll ignore the fact that this would be a pretty huge set of people to keep up with the sheer quantity of crap being developed and skip straight to the explanation for why this wouldn't work.
Yeah, sure, this vulnerability was obvious. But what about the product from a well-known vendor that included a debug app listening on a high numbered UDP port that accepted a packet of the form "BackdoorPacketCmdLine_Req" and then executed the rest of the payload as root? A portscan's not going to show that up[1]. Finding this kind of thing involves pulling the device apart, dumping the firmware and reverse engineering the binaries. It typically takes me about a day to do that. Amazon has over 30,000 listings that match "IP camera" right now, so you're going to need 99 more of me and a year just to examine the cameras. And that's assuming nobody ships any new ones.
Even that's insufficient. Ok, with luck we've identified all the cases where the vendor has left an explicit backdoor in the code[2]. But these devices are still running software that's going to be full of bugs and which is almost certainly still vulnerable to at least half a dozen buffer overflows[3]. Who's going to audit that? All it takes is one attacker to find one flaw in one popular device line, and that's another botnet built.
If we can't stop the vulnerabilities getting into people's homes in the first place, can we at least fix them afterwards? From an economic perspective, demanding that vendors ship security updates whenever a vulnerability is discovered no matter how old the device is is just not going to work. Many of these vendors are small enough that it'd be more cost effective for them to simply fold the company and reopen under a new name than it would be to put the engineering work into fixing a decade old codebase. And how does this actually help? So far the attackers building these networks haven't been terribly competent. The first thing a competent attacker would do would be to silently disable the firmware update mechanism.
We can't easily fix the already broken devices, we can't easily stop more broken devices from being shipped and we can't easily guarantee that we can fix future devices that end up broken. The only solution I see working at all is to require ISPs to cut people off, and that's going to involve a great deal of pain. The harsh reality is that this is almost certainly just the tip of the iceberg, and things are going to get much worse before they get any better.
Right. I'm off to portscan another smart socket.
[1] UDP connection refused messages are typically ratelimited to one per second, so it'll take almost a day to do a full UDP portscan, and even then you have no idea what the service actually does.
[2] It's worth noting that this is usually leftover test or debug code, not an overtly malicious act. Vendors should have processes in place to ensure that this isn't left in release builds, but ha well.
[3] My vacuum cleaner crashes if I send certain malformed HTTP requests to the local API endpoint, which isn't a good sign
To fix this properly we need to get rid of the compromised systems. The question is how. Many of these devices are sold by resellers who have no resources to handle any kind of recall. The manufacturer may not have any kind of legal presence in many of the countries where their products are sold. There's no way anybody can compel a recall, and even if they could it probably wouldn't help. If I've paid a contractor to install a security camera in my office, and if I get a notification that my camera is being used to take down Twitter, what do I do? Pay someone to come and take the camera down again, wait for a fixed one and pay to get that put up? That's probably not going to happen. As long as the device carries on working, many users are going to ignore any voluntary request.
We're left with more aggressive remedies. If ISPs threaten to cut off customers who host compromised devices, we might get somewhere. But, inevitably, a number of small businesses and unskilled users will get cut off. Probably a large number. The economic damage is still going to be significant. And it doesn't necessarily help that much - if the US were to compel ISPs to do this, but nobody else did, public outcry would be massive, the botnet would not be much smaller and the attacks would continue. Do we start cutting off countries that fail to police their internet?
Ok, so maybe we just chalk this one up as a loss and have everyone build out enough infrastructure that we're able to withstand attacks from this botnet and take steps to ensure that nobody is ever able to build a bigger one. To do that, we'd need to ensure that all IoT devices are secure, all the time. So, uh, how do we do that?
These devices had trivial vulnerabilities in the form of hardcoded passwords and open telnet. It wouldn't take terribly strong skills to identify this at import time and block a shipment, so the "obvious" answer is to set up forces in customs who do a security analysis of each device. We'll ignore the fact that this would be a pretty huge set of people to keep up with the sheer quantity of crap being developed and skip straight to the explanation for why this wouldn't work.
Yeah, sure, this vulnerability was obvious. But what about the product from a well-known vendor that included a debug app listening on a high numbered UDP port that accepted a packet of the form "BackdoorPacketCmdLine_Req" and then executed the rest of the payload as root? A portscan's not going to show that up[1]. Finding this kind of thing involves pulling the device apart, dumping the firmware and reverse engineering the binaries. It typically takes me about a day to do that. Amazon has over 30,000 listings that match "IP camera" right now, so you're going to need 99 more of me and a year just to examine the cameras. And that's assuming nobody ships any new ones.
Even that's insufficient. Ok, with luck we've identified all the cases where the vendor has left an explicit backdoor in the code[2]. But these devices are still running software that's going to be full of bugs and which is almost certainly still vulnerable to at least half a dozen buffer overflows[3]. Who's going to audit that? All it takes is one attacker to find one flaw in one popular device line, and that's another botnet built.
If we can't stop the vulnerabilities getting into people's homes in the first place, can we at least fix them afterwards? From an economic perspective, demanding that vendors ship security updates whenever a vulnerability is discovered no matter how old the device is is just not going to work. Many of these vendors are small enough that it'd be more cost effective for them to simply fold the company and reopen under a new name than it would be to put the engineering work into fixing a decade old codebase. And how does this actually help? So far the attackers building these networks haven't been terribly competent. The first thing a competent attacker would do would be to silently disable the firmware update mechanism.
We can't easily fix the already broken devices, we can't easily stop more broken devices from being shipped and we can't easily guarantee that we can fix future devices that end up broken. The only solution I see working at all is to require ISPs to cut people off, and that's going to involve a great deal of pain. The harsh reality is that this is almost certainly just the tip of the iceberg, and things are going to get much worse before they get any better.
Right. I'm off to portscan another smart socket.
[1] UDP connection refused messages are typically ratelimited to one per second, so it'll take almost a day to do a full UDP portscan, and even then you have no idea what the service actually does.
[2] It's worth noting that this is usually leftover test or debug code, not an overtly malicious act. Vendors should have processes in place to ensure that this isn't left in release builds, but ha well.
[3] My vacuum cleaner crashes if I send certain malformed HTTP requests to the local API endpoint, which isn't a good sign
no subject
Date: 2016-10-22 05:33 am (UTC)Is lesson one perhaps "don't live in a country with anti-circumvention laws?"
no subject
Date: 2016-10-22 09:21 am (UTC)Or, repeal them when you find them.
Cutting of single devices
Date: 2016-10-22 07:17 am (UTC)Re: Cutting of single devices
Date: 2016-10-22 03:03 pm (UTC)Devices will be directly exposed to internet more often (either by misconfiguration or voluntarily) and they will have a more complex network stack in many cases.
On the other hand, it will be much harder to scan the IPv6 address-space for vulnerable devices and there will be less complex network stack once we have abandoned IPv4 (no more NAT).
I think the benefits outweigh the cons by far with IPv6 since quickly scanning for vulnerable devices is a very strong reason why we see all the crap now. To have simpler protocols and simpler setups is also a good reason to strive for it in the long run as that benefits security as well. Temporary it will cause some issues (dual stacks and misconfigured setups due to lack of knowledge by the user/technicians) but that will quickly change when IPv6 become more common.
No incoming connections by default
Date: 2016-10-22 09:08 am (UTC)Given that the first step in infecting vulnerable devices is a port scan, by default ISPs could block all incoming connections until the client explicitly requests that incoming connections should be unblocked.
The catch is I expect ISPs would completely fsck this up and it would be a pain to get things working properly if you know what you are doing.
Re: No incoming connections by default
Date: 2016-10-22 12:57 pm (UTC)Re: No incoming connections by default
From: (Anonymous) - Date: 2016-10-24 10:54 pm (UTC) - ExpandRe: No incoming connections by default
From: (Anonymous) - Date: 2016-10-28 05:36 pm (UTC) - ExpandHow about open source?
Date: 2016-10-22 09:47 am (UTC)My statement follows the logic that if there had been this law imposed much earlier, all these companies would have end up joining forces in trying to write joint-written firmware (so that the code is not maintained by a single company) to de-duplicate efforts and spread the responsability.
Re: How about open source?
Date: 2016-10-22 10:28 am (UTC)Re: How about open source?
From: (Anonymous) - Date: 2016-10-22 12:31 pm (UTC) - ExpandRe: How about open source?
From: (Anonymous) - Date: 2016-10-23 11:10 am (UTC) - ExpandRe: How about open source?
From:Re: How about open source?
From: (Anonymous) - Date: 2016-11-01 11:38 am (UTC) - ExpandRe: How about open source?
From: (Anonymous) - Date: 2016-10-23 04:27 pm (UTC) - ExpandRe: How about open source?
From: (Anonymous) - Date: 2016-10-22 01:01 pm (UTC) - ExpandRe: How about open source?
From: (Anonymous) - Date: 2016-10-22 01:15 pm (UTC) - ExpandRe: How about open source?
From:Re: How about open source?
From: (Anonymous) - Date: 2016-10-22 06:05 pm (UTC) - ExpandRe: How about open source?
From:Re: How about open source?
From: (Anonymous) - Date: 2016-10-23 05:35 am (UTC) - ExpandRe: How about open source?
From: (Anonymous) - Date: 2016-11-01 11:43 am (UTC) - ExpandHome routers
Date: 2016-10-22 01:21 pm (UTC)There's an economic solution to this
Date: 2016-10-22 01:36 pm (UTC)Re: There's an economic solution to this
Date: 2016-10-22 03:49 pm (UTC)Re: There's an economic solution to this
From: (Anonymous) - Date: 2016-10-23 09:05 pm (UTC) - ExpandAn idea
Date: 2016-10-22 02:03 pm (UTC)I haven't thought this through, but how about something like this:
* Forbid commercial import of devices that have been found to be vulnerable (unless the importer undertakes to update their firmware before selling them)
* Forbid the sale of new, already imported devices that have been found to be vulnerable (so, not targeted at consumers selling their used devices)
These I believe could create a few interesting incentives:
* Manufacturers would have an incentive to think of security if they run a risk of not being able to sell them to major markets
* There would be an incentive to find vulnerabilities in competitors' devices and give an anonymous tip
* Commercial importers would have an incentive to try and choose better devices or ones where the manufacturer somehow promises to rectify problems, since they run the risk of being stuck with unsaleable stock
This rule seems a bit harsh in some ways, especially for vendors who really try hard to secure their devices but fail because of, say, some Linux vulnerability. I think it should probably be enough if there are no known vulnerabilities older than, say, 45 days for which there is no firmware update available.
Re: An idea
Date: 2016-10-22 10:16 pm (UTC)Something more realistic would be to provide an easy-to-use, secure by default platform that chip vendors could base their BSPs on. A lot of the cheap products base their software more or less directly on the vendor's BSP, and those are frequently some crap thrown together just to get a booting system. It's not unusual to see BSPs still based on some 2.4 kernel, and never updated. Something like Yocto just has a too steep learning curve, and doesn't solve the problem of vendors sticking to outdated versions.
no subject
Date: 2016-10-22 02:58 pm (UTC)no subject
Date: 2016-10-22 05:23 pm (UTC)launch a counter-attack.
we know where the attacks are coming from, so break into those devices and either lock them or (with a dark-grey hat) brick them.
Bricking
From: (Anonymous) - Date: 2016-10-25 08:32 am (UTC) - Expand(no subject)
From: (Anonymous) - Date: 2016-10-24 07:47 am (UTC) - ExpandForce internet connected devices to be rented
Date: 2016-10-22 04:52 pm (UTC)With this, the choice not to update the firmware is ripped out of the customer's hands. ISPs have an incentive not to let their networks participate in attacks and actually ensure updates make their way to customers so they actually pass updates for hardware they provide on to consumers.
A secondary effort is made to ensure everyone is forced to keep changing (e.g. by using a Linux-eseque upgrade all at once system for protocols). Soon old devices struggle to connect to the internet at all due to the never ending technological changes. All the updates burn through a limited amount of flash rewrite cycles thus creating planned obsolescence or forcing the customer to purchase a new USB key with the latest firmware on it. At best you can buy an auto-updated device for "legacy" devices but they're never allowed to connect to the real Internet only some faux house internal one.
Re: Force internet connected devices to be rented
Date: 2016-10-24 10:15 am (UTC)I think there is some confusion here. A TV does not need to be hosted (listening) publicly on the Internet. AFAIK, all Internet-enabled TVs (and devices of a similar ilk), simply make outbound connections and any inbound connections would be blocked by the home router by default.
The only devices that need to be hosted publicly on the Internet (ie. with a listening socket) are those that you need to connect to from outside your home network. So, IP security cameras, etc. Not home devices such as TV's or lightbulbs.
Ofc, I could have the wrong end of the stick here. Apologies if so :-)
Re: Force internet connected devices to be rented
From: (Anonymous) - Date: 2016-10-25 12:40 pm (UTC) - ExpandRe: Force internet connected devices to be rented
From: (Anonymous) - Date: 2016-10-25 01:19 pm (UTC) - ExpandRe: Force internet connected devices to be rented
From: (Anonymous) - Date: 2016-10-25 04:15 pm (UTC) - ExpandIt's our responsibility
Date: 2016-10-22 07:46 pm (UTC)I know that this is not a popular view within the computer science and open source communities but: this is our problem, not the vendors'.
We ship open source software used by these vendors with unsafe defaults. We don't default closed or put giant PEOPLE_WILL_DIE_IF_YOU_DO_THIS text on our configuration variables. We ship compilers and languages that don't put safety and buffer overflow protection first. Hell, we don't even systematically regression test (let alone fuzz test) the software that our communities produce.
We ship crap code and we expect downmarket vendors to polish it.
We have to fix the problem; no one else will.
There are glimmers of hope: there's healthy projects like boringssl. There's basic language safety efforts like Rust. There's healthy discourse about handling security better within the Linux kernel community. And if that doesn't work out, there's long-shots efforts like user-mode drivers in Magenta.
The first place that any open source contributor can begin is to hold ourselves to a higher standard:
maybe we should build better platform ?
Date: 2016-10-22 09:18 pm (UTC)1. Design a secure architecture - on that the vendor cannot mess up, and all updates are from providers we can count on.
2. Somewhat forcefully shove it in chips. silicon is cheap.
3. Make sure it's extremely cheap on the one hand, and on the other, find some carrot or stick to make sure only/mostly "good" devices enter the market.
Re: maybe we should build better platform ?
Date: 2016-10-23 12:12 am (UTC)A closed system runs into problems with lock-out, forcing people to upgrade their old devices without a legal stick isn't going to work (and people are not going to VLAN off their crappy cameras if they haven't already), and all of our solutions for distributed webs of trust are vulnerable to majority takeover (say, if you compromise the largest vendor in the space).
It's not hopeless, it's just all imperfect solutions.
no subject
Date: 2016-10-23 12:06 am (UTC)No experience with actual IP cameras (versus dumb cameras that only knew how to communicate over closed circuit to a DVR), but I would expect the DVR case to be the better bang/buck (there are probably more distinct internet connections with just one or two IP cameras instead of something managing them, but even if they're mostly the same stock board, there's probably many more vendors to convince to update their shit).
what about ipfs etc?
Date: 2016-10-23 01:33 am (UTC)I was surprised that the solutions section didn't mention alternate Internet infrastructure that are more resilient. The first one I think of is the Interplanetary File System.
no subject
Date: 2016-10-23 06:21 am (UTC)https://ablis.business.gov.au/VIC/pages/1e057cce-d835-4a4b-91b7-d733fda05ec4.aspx
Hobbyists are allowed to do some stuff themselves, but not allowed to sell it.
Likewise, home routers could be legally required to meet certain standards before being allowed to be plugged in, and that could include having a separate network for iOT devices in which they are required to pre-register hosts they wish to communicate with and be approved before they could be used.
And use the existing legal framework that we have here and probably in most countries for fines and recalls of faulty equipment which doesn't meet the standards, and fines for hobbyists who build their own without it being up to scratch.
As for countries which don't enforce protections against DDoS. Yes, the only solution is to cut them off or rate limit their egress. The current situation where a single actor can, with complete anonymity, take anyone but a handful of giant organisations entirely off the air is broken. When they get powerful enough to take all the DNS roots out at the same time, we're really screwed.
no subject
Date: 2016-10-23 11:04 am (UTC)What about connected devices? Does the hardware and server have to be certified as one system? That shifts the burden (and cost!) of certification to the customer, which can be enormously expensive and time-consuming. Want to set up a Linux media server in your home? Not until you pay to get your home network and TV certified! And don't even think about changing the configuration or installing updates later, either.
Allow maintenance
Date: 2016-10-23 04:21 pm (UTC)Yes. You do this by not-having anything for which the software _cannot_ be maintained. It doesn't necessarily have to _be_ maintained or have updates be available from any particular party (e.g. the vendor or manufacturer). There only needs to be a total and complete lack of barriers which might _prevent_ any interested party from performing the software maintenance. Then, if people want the maintenance enough, someone will do it. (Maybe for money, maybe not.)
If barriers to maintenance exist, you use government force to remove the barrier. Nobody can make a case for lack of software maintenance being a desirable, or even tolerable, thing.
Re: Allow maintenance
Date: 2016-10-28 04:19 pm (UTC)Also, it would still require a massive effort, because to be effective, you have to find and patch the security holes *before* malicious actors exploit them; as Matthew mentioned, competent attackers will disable update mechanisms if at all possible.
opt-in subscription on notifications about your devices being used in attacks
Date: 2016-10-23 06:33 pm (UTC)int_ua
Use the client mode
Date: 2016-10-24 05:48 am (UTC)No mucking around, opening ports on your gateway/firewall.
Kedar.
Re: Use the client mode
Date: 2016-10-24 02:06 pm (UTC)I've been thinking this ever since IoT started to take off. I suspect the main issue of a central server is the cost of setting up and maintaining it.
Also, it goes without saying that the server itself will need to be bulletproof, security-wise. As it will be an obvious target for attacks itself.
Gatewayed networks
Date: 2016-10-24 09:14 am (UTC)See http://blog.gerv.net/2016/03/an-iot-vision/ , https://blog.gerv.net/2016/10/security-updates-not-needed/ and https://blog.gerv.net/2016/10/no-default-passwords/ .
Scare people into updating their devices
Date: 2016-10-24 09:29 am (UTC)no subject
Date: 2016-10-24 10:12 am (UTC)http://arstechnica.co.uk/business/2016/10/ubuntu-snap-packaging-internet-of-things-security/
It's extremely easy.
Date: 2016-10-24 05:30 pm (UTC)I really wonder about this discussion.
The problem is, that the manufacturers did not even tried to make their devices secure.
Fixed passwords?
20 years ago - ok.
Today? - Just let them pay the invoice.
For example, if a device is misused in an attack, then the Manufacturer has to pay 10$ per sold device for the 1st attack. 20$ for the 2nd attack.
I'm pretty sure they'll follow basic security rules extremely fast and they will offer patches in no time.
Kind regards, Tom
Re: It's extremely easy.
Date: 2016-10-24 05:36 pm (UTC)How is NAT failing?
Date: 2016-10-25 03:16 pm (UTC)Build a bot net to shut down insecure devices
Date: 2016-10-26 07:37 am (UTC)Re: Build a bot net to shut down insecure devices
Date: 2016-10-28 04:31 pm (UTC)Also, it's not just someone 'crying illegal'. Your proposal is to destroy goods that people have bought fair and square. Why is that morally better than the botnets you're trying to prevent? The owners of the hardware would probably not think it is.
no subject
Date: 2016-11-22 12:55 pm (UTC)A big part of the problem is that it's possible to ignore the problem right up until your house bursts into flames or the police show up. A policy of NO LOLCAT NO PORN NO NETFLIX until you unplug that damn thing would dramatise the whole issue and probably precipitate a political solution.