News for hackers. Stuff that matters.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mikeash on Tuesday April 28, 2015 @12:22PM (#9453397)
It's hard to see how it could be fixed. Fundamentally, what is different about a local key fob, and a relay connected to a remote key fob? It seems fundamentally impossible to tell the difference.

The one thing that I could see working in theory would be detecting the roundtrip transmission time with a strict ceiling on it. No matter how good your relay is, it can't relay data faster than the speed of light, so you can enforce the fob being close by only listening to it if it responds fast enough.

The problem with this is that light moves pretty fast, and internal delays within the fob will dominate. If you want to put the range limit at, say, 30ft, that means your response time ceiling is a mere 60ns. Can you build a fob that responds anywhere close to that fast?

Edit: one other possibility is if the fob knows where it is. A GPS receiver on the fob, for example, would allow the fob and the car to securely confirm proximity (absent GPS spoofing). Getting a GPS receiver to run on a wireless fob's battery is left as an exercise for the reader.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by halviti on Tuesday April 28, 2015 @12:56PM (#9453683)
I think this is an easy problem to fix, no?

Why not just make the keys responsible for starting the car again?

We've traded too much security for convenience and it's time to take a step back.

You can still start the car with the push of a button.. only now that button is on the key.

Problem solved.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mikeash on Tuesday April 28, 2015 @01:40PM (#9453998)
The implied context here was "while keeping wireless keyfobs."

Yes, the problem becomes substantially easier if you require a direct physical connection, but that's not such an interesting problem.

Also, given that modern cars are vastly more difficult to steal, I object to your characterization of "traded too much security for convenience." If the current state is too insecure, then you must think that cars from 20+ years ago are absolutely appalling.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by Vraxx on Tuesday April 28, 2015 @02:25PM (#9454258)
I think he was not saying a physical connection was necessary, only that a physical button on the key fob was necessary to start the car. Still wireless, it just requires interaction from the driver who must physically have the key fob.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mikeash on Tuesday April 28, 2015 @02:35PM (#9454317)
Oh yes, that would obviously work, but of course you're changing the nature of the device. There are some easy ways to prevent relaying if you're open to that. It's more interesting to me to think about how you might solve the problem without changing anything from the user's perspective.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by Vraxx on Tuesday April 28, 2015 @02:59PM (#9454437)
Ah yeah, I'd like that more as well because I really like driving without ever taking the keys out of my pocket :P I was mostly clarifying for the person you responded to.

Although from what I was seeing in the rest of the thread it seemed that preventing relaying may be more difficult than expected (as most methods relied on timing the signal response). I don't expect it to be impossible though.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by hn_ on Tuesday April 28, 2015 @02:37PM (#9454323)
Can you explain to me why older cars are easier to steal? I'm not familiar with auto theft/security and I'm curious.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mikeash on Tuesday April 28, 2015 @02:50PM (#9454399)
Really old cars have very simple electronics. Even after computers started showing up in cars, they were pretty simple and didn't interact much with the security aspect of things. When you start a car like this, you're just making a connection between two wires to power up the electronics, and briefly making a connection between another two wires to run the starter motor. The only security in the whole system is provided by the fact that the connection is made by a switch that requires a key to turn it. If you don't have the right key, you can't turn the switch, and that means you can't connect the wires.

The trouble is that the wires must be fairly exposed to the occupants of the car, since the switch has to be accessible. That means you can just bypass the switch entirely by removing the appropriate covers and attacking the wires directly. This is "hotwiring."

Physical locks are also not all that difficult to defeat directly. You can pick an ignition switch much like you might pick any other lock.

Starting around the late 90s or so, car manufacturers started adding more robust security measures. These include things simple like locking the steering column when the ignition switch is off (thus preventing you from driving the car after hotwiring it), all the way up to authenticating the key with a relatively sophisticated protocol, and having the engine computer refuse to run the car unless it can sense a real key.

As a result of these changes, the list of most stolen car models is still topped by cars manufactured in the late 90s. Low-end Hondas from around 1998 are right at the top of the list, because they occupy a sweet spot of being relatively valuable and still fairly easy to steal. Modern cars are stolen literally orders of magnitude less frequently; about 100,000 older Hondas stolen per year in the US, whereas new cars are stolen at a rate of hundreds per model per year at worst. Also as a natural result of these changes, car theft is way down in the US. About 700,000 cars were stolen in the US in 2013, compared to almost 1.7 million in 1991. Pretty much the only way to steal a newer car is to either tow it away or steal the owner's keys. (A common scenario for car thefts is a burglary turned into auto theft when the burglars find car keys in the house.)

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by majormajor on Tuesday April 28, 2015 @02:49PM (#9454396)
Here's a few I remember off the top of my head.

It's easy to get into many older cars. Slim jim past the window is the classic example (and I opened my 80s Toyota with a coathanger multiple times when I locked myself out), but many times the locks could be opened by keys to other cards from the same manufacturer as well, they just didn't seem to be that precise. And of course, smash the window as a last resort, that wouldn't set off an alarm in the past. Nowdays cars have recessed lock things in the door panels (or button-controlled-locks that can't be as easily manipulated with a coathanger, or even that don't work at all if the car was locked from outside) to help prevent this, and the interior of the doors has more protection built around the lock mechanism so you can't easily fish through there and hook onto the right lever.

Once inside an old car, starting it is usually just a matter of shorting the right pair of wires. Or using brute strength to turn the ignition cylinder even if they key isn't an exact match (or maybe with a screwdriver, as another poster mentioned doing in the past in this thread). Modern cars have chips in the keys so that it's not just a matter of closing a circuit, the key has to be coded to the car.

Or just tow the car somewhere and work on picking the lock later at your leisure. Overkill for a common car, but for something really nice it could be practical. Nowdays your more expensive cars have tilt and motion sensors that'll set off the alarm if you locked it, left it, and someone else comes up and tries to tow it. Possibly GPS tracking or similar as well, IIRC, on some fancy stuff.

The fob-in-pocket entry/pushbutton start stuff gives up some of those improvements given an exploit like this, but overall I'd say is still much more secure. You need specialized hardware (that's only useful for breaking into someone else's car) and it wouldn't work to, say, steal cars from an airport parking lot or somewhere else where they were left and the owner wasn't in range. Keeping your car in a garage at home seems to mitigate a lot of the easiest vectors for this attack.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by manarth on Tuesday April 28, 2015 @05:24PM (#9455250)
To add to the comments about immobilisers, in a number of countries (UK and Germany, amongst others), from 1998 all new cars were required to have an engine immobiliser. Most manufacturers simply made them standard for all countries, so nearly all cars built since 1998 have had them fitted.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by TheLoneWolfling on Tuesday April 28, 2015 @01:01PM (#9453718)
Agreed.

Your opinion is an unpopular one, albeit one I share.

There are far too many cases where security is getting removed in the name of convenience, and this is no exception.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by URSpider94 on Tuesday April 28, 2015 @05:46PM (#9455329)
It's important to look at this in the context of overall auto theft trends. Auto theft has dropped by more than 50% over the past decade, driven mostly by the broad use of smart keys. (http://www.iii.org/issue-update/auto-theft). The lion's share of the thefts are of older cars (mentioned in the above cite) -- thefts of 2013 vehicles number in the hundreds.

Further, a Tesla has a GPS, sophisticated processor, and a 4G WAN. It would be easy enough to have the car report back to the owner if it's being driven without sensing the key, and give the owner the option to route a theft report and live location of the vehicle to police with one click. That's something I wished for in my revenge fantasies when my car was stolen a decade ago.

We could do more, sure -- but it's hard to argue that we are making cars less secure, or even that car security should be a major care-about for the buyer.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by greglindahl on Tuesday April 28, 2015 @09:14PM (#9456038)
The main issue with newer cars is people stealing your stuff from your unlocked car.

The Tesla app does show the car location on a map; they don't have a "report to police" option, but they aren't that far away from it.

BTW the Tesla modem is 3G.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by maxerickson on Tuesday April 28, 2015 @12:28PM (#9453456)
From a previous discussion:

https://news.ycombinator.com/item?id=9383462

https://en.wikipedia.org/wiki/Distance-bounding_protocol

(I don't pretend to have a clue whether it can be effective or not)

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mikeash on Tuesday April 28, 2015 @01:40PM (#9454000)
Thanks, nice to know that it has a name.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by birdman3131 on Tuesday April 28, 2015 @02:21PM (#9454230)
I could see several ways.

1. Use a modified form of triangulation. Have multiple transceivers in the car (At the front and back) and make the remote directional aware. Then have the remote and transceivers ask each other if the angles they are seeing are the same. The only way for the thieve to bypass this would be two remote amps set at almost 180 from each other.

2. stick an ultrasonic speaker in the key fob and have the car send it a random sequence to play back. For those worried about battery life use a wireless charging system.

Both of these assume that the transmission is encrypted and the thieves are just boosting the signal.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mbrubeck on Tuesday April 28, 2015 @07:33PM (#9455734)
In the attack described here: http://media.hacking-lab.com/scs3/scs3_pdf/SCS3_2011_Capkun....

the attacker has two devices communicating by radio. Device A is near the keyfob, and device B is near the car. Each is a repeater for the other: Whatever the car sends is picked up by device B and repeated by device A. Then the keyfob's response is picked up by device A and repeated by device B.

This type of setup will defeat both of your proposals. Triangulation won't detect anything out of the ordinary, because device B can be right next to the car. And the ultrasonic challenge/response can be defeated just like a radio challenge/response, using microphones and speakers on the repeaters.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mikeash on Tuesday April 28, 2015 @02:34PM (#9454312)
I don't believe it's possible to do triangulation in anything like a remotely accurate fashion with anything that'll fit in your pocket.

I don't see how ultrasound helps matters at all. You just change the nature of what the attacker has to relay.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by tzs on Tuesday April 28, 2015 @07:39PM (#9455759)
Ultrasound helps because the speed of sound in air is much lower than the speed of radio waves. This makes it massively easier to do distance measurements.

Rather than put an ultrasonic speaker in the fob, I'd put a microphone. The car would send an ultrasonic signal, and the fob would send a radio response indicating it heard it. The car could then calculate how far away the fob is.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mikeash on Tuesday April 28, 2015 @07:55PM (#9455821)
Ultrasound also makes it massively easier to spoof distance measurements, because there's nothing that requires the attacker to use ultrasound for his own transmissions.

The speed of sound in air is about 1ms/foot, so if you're trying to measure proximity within 30ft, you're looking for a 60ms roundtrip delay, or 30ms for one-way. If the attacker has ultrasonic microphones and speakers connected with radio waves, that means he can spoof your fob from up to 9,000km away for roundtrip ultrasound, and 4,500km away for one-way, under ideal conditions.

The speed of light imposes difficult constraints in terms of how fast you have to respond, but at least the attacker can't outrun it (as far as anyone knows).

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by tzs on Tuesday April 28, 2015 @09:00PM (#9455986)
The description I saw of the amplifier attack said that the attacker put an amplifier near the car. This amplified the car's weak signal so it could reach the fob, which would then respond. The attacker does not have any equipment near the fob (and may not even know where it is).

If the car then did an ultrasonic distance check by emitting a coded ultrasonic signal that the fob had to receive, and then relay the code back to open the door, I don't see how the attacker would spoof that. Even if he has an ultrasonic microphone near the car, and an ultrasonic transmitter somewhere else, with a radio link to tell the transmitter what the send...how does he place the transmitter so that your fob will hear it?

If the attack is targeted against a specific individual, where the attacker knows both where the car is parked and where the individual is when away from the car, and the attacker can place equipment at both locations, then yes, I see that the attacker can get around ultrasonic distance measurement.

But for the most common case, where the attacker is at the car and has no idea where the owner is, it seems workable to me.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mikeash on Wednesday April 29, 2015 @10:52AM (#9458654)
Right, I see, that makes sense and your idea would definitely help there. It wouldn't defeat a more targeted attack, but just defeating a simpler one could be worthwhile.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by lsaferite on Tuesday April 28, 2015 @01:01PM (#9453715)
It took a few minutes for the 'relay' portion of what you just wrote to click.

So, in theory, if you wanted to steal a REALLY expensive keyless car you could have two devices connected over a mobile data connection that just relays communication with the keyfob. You put one device near the owner of the fob, so in his office, and you keep the other. Then you can just walk off with the car.

Yikes.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mbrubeck on Tuesday April 28, 2015 @01:12PM (#9453798)
Yep - here's a presentation on these relay/repeater attacks by some researchers who actually build some: http://media.hacking-lab.com/scs3/scs3_pdf/SCS3_2011_Capkun....
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by TheLoneWolfling on Tuesday April 28, 2015 @01:08PM (#9453779)
Yep, that's pretty much it.

Although sometimes you can even skip the second device and just have the one near the keyfob.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by Dylan16807 on Tuesday April 28, 2015 @12:34PM (#9453506)
You can try to detect the amplified signal, and if you put an accurate timer in the fob you can make it take exactly 5000ns to process and then require a signal back within 5020ns.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by TheLoneWolfling on Tuesday April 28, 2015 @12:53PM (#9453663)
Detecting the amplified signal won't work. There are these things known as directional antennas...

The timer idea is a good one, although a ns-accurate timer is starting to get a bit much for something to put into a key fob. Especially give it's run off of a watch battery (power requirements) and often exposed to heat / cold (thermal drift).

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by anologwintermut on Tuesday April 28, 2015 @01:15PM (#9453816)
The timer could be in the car. Protocol looks like fob pings car, car challenges fob, fob responds.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by TheLoneWolfling on Tuesday April 28, 2015 @01:50PM (#9454063)
Nope.

Dylan's comment requires a timer in both the key fob and in the car. The key fob to delay transmission of the challenge response, the car to check if there isn't too much delay in the challenge / response pair.

You really need a timer in the key fob, as the processor in the key fob is often so slow (for battery / cost reasons) that an extra couple clock cycles somewhere would throw off the timing enough to make it fail.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by anologwintermut on Tuesday April 28, 2015 @02:20PM (#9454227)
The usual distance bounding protocols only need a nano-second accurate timer on one device called the verifier. For example https://www.usenix.org/legacy/event/sec10/tech/full_papers/R...

Cool trick in that one, the Prover(i.e. the key fob) does the distance measuring part of the challenge response protocol using analog only components. This means its response time is <1 nano second.

So you can do it with only the car having a good timer.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by Dylan16807 on Tuesday April 28, 2015 @01:11PM (#9453792)
Well for the example timing I gave you only need 1 part per thousand accuracy, and it's easy to get 10ppm or much better. It only needs to run during communication, anyway.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mikeash on Tuesday April 28, 2015 @02:37PM (#9454326)
I can't edit anymore, but expanding on the GPS idea: I just realized that we pretty much all carry around a GPS-enabled "fob" these days. If you switched away from using a dedicated fob and instead authenticated against a person's phone, you could double-check proximity that way. It would only need a quick check before opening the car, so battery life shouldn't be affected too much.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mbrubeck on Tuesday April 28, 2015 @12:45PM (#9453591)
Theoretically you could use quantum key distribution, but in practice this usually requires a fiber-optic connection.

https://en.wikipedia.org/wiki/Quantum_key_distribution

Edit: Nope, I am wrong, as the comments below point out.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by sp332 on Tuesday April 28, 2015 @12:50PM (#9453637)
Even with QKD, an attacker that just passes data along without trying to read or change it is nearly undetectable.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by Strilanc on Tuesday April 28, 2015 @12:50PM (#9453641)
I don't see how that helps. QKD stops eavesdroppers, not amplifiers.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by Sir_Cmpwn on Tuesday April 28, 2015 @12:47PM (#9453611)
Would it be possible to establish a secure connection and exchange a secret key?
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by sp332 on Tuesday April 28, 2015 @12:49PM (#9453626)
No. This could relay the challenge to the key, and the response back to the car. The attacker doesn't have to know any secrets to do that attack.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by prsutherland on Tuesday April 28, 2015 @12:59PM (#9453703)
If you put the car's public key on the fob, the fob can validate that it is talking directly to the car over a secure connection and then the car can validate the fob's secret.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by TheLoneWolfling on Tuesday April 28, 2015 @01:11PM (#9453796)
Please elaborate as to how the fob or car would detect the MITM:

1. You place device A near car and device B near fob. 2. Device A relays all Rf transmissions in the target frequency range(s) to device B, which rebroadcasts, and vice versa.

Public-key encryption / authentication only ensures that no-one in the middle is reading or editing your connection. It does not prevent someone from relaying your communication. (And a good thing too, else the entire encrypted web wouldn't work.)

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by jedunnigan on Wednesday April 29, 2015 @01:36AM (#9456620)
Well, there may be one way. But it's not user friendly at all.

When the driver presses lock/unlock on the fob, the car first sends a signed message with a session secret. The fob checks the signature, takes the secret and creates a _single use_ auth token and signs it with the private key stored on the fob. That signed auth token is then sent from the fob to the car to lock/unlock the car.

To check if there was a MITM you would have to pull the door handle to see if your keypress was successful. If it was successful, you don't need to worry if the key was grabbed by a MITM, they can't use it even if they tried. If it was unsuccessful for some reason (e.g. the MITM knew it was single use auth token so they didn't pass the token onto the car in hopes you might not be paying attention and will press the button a second time) then there should be a manual override outside and inside the car that clears the valid auth tokens and allows you to lock/unlock/start the vehicle without sending any RF transmissions. A slot that you insert the key would work.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by TheLoneWolfling on Wednesday April 29, 2015 @05:28PM (#9461930)
You're assuming user interaction with the key fob, in which case the solution is trivial.

The entire discussion here is based around not requiring interaction with the key fob.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by Sir_Cmpwn on Tuesday April 28, 2015 @01:43PM (#9454020)
What if the car sent out the signal and the fob received it, then sent an unlock command?
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by TheLoneWolfling on Tuesday April 28, 2015 @01:48PM (#9454051)
Note the vice versa:

In that case device B picks up on the unlock command and relays is back to device A which rebroadcasts the unlock command to the car.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by Sir_Cmpwn on Tuesday April 28, 2015 @01:57PM (#9454095)
Presumably the request could be signed.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by mikeash on Tuesday April 28, 2015 @02:03PM (#9454145)
Signatures do nothing to prevent blind relaying. Transmitting through an amplifying relay in this attack looks identical to transmitting through free space, aside from the received power level and propagation delay.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by Sir_Cmpwn on Tuesday April 28, 2015 @02:14PM (#9454200)
I'm suggesting that the car sends out a constant, signed signal to a certain range. The rob receives it and sends an unlock signal back to the car.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by dangrossman on Tuesday April 28, 2015 @02:20PM (#9454224)
The amplifier relays that signed signal to the fob. The fob receives it and its unlock signal is relayed back to the car.

No matter what tricky message protocol you come up with, it won't matter. The car and the fob can't detect the difference between being next to each other, and being next to a set of relays rebroadcasting their signals. Not by reading and transmitting radio signals at least.

Re:Tesla Plans to Open Car Doors to All Hackers This Summer by Sir_Cmpwn on Tuesday April 28, 2015 @02:23PM (#9454247)
Ah, I see. You're right, then.
Re:Tesla Plans to Open Car Doors to All Hackers This Summer by stonemetal on Tuesday April 28, 2015 @02:10PM (#9454182)
You can't think about this like internet security. Normal encryption doesn't care how long the network cord is. Opening your car door does. This attack lengthens the cord between client and server without touching the data on the cord so that you are genuinely logged in from an encryption standpoint, but from a world standpoint you are sitting at your office desk unable to see your car.