8 ms·
Hacker Unlocks ‘High Security’ Electronic Safes Without a Trace
- deutronium 10y agoYou can get the slides here - https://media.defcon.org/DEF%20CON%2024/DEF%20CON%2024%20presentations/DEFCON-24-Plore-Side-Channel-Attacks-On-High-Security-Electronic-Safe-Locks.pdf https://media.defcon.org/DEF%20CON%2024/DEF%20CON%2024%20pre... It really is a clever attack! I'm really surprised at the way he mentions the microcontroller tests if the key is correct or not, by simply looping through and breaking on an incorrect number.
- pwg 10y agoNot surprising at all. It is a standard pattern when programming for performance (which is what 99.9% of programmers are going for 99.9% of the time). Once you are sure the answer's wrong, don't bother testing any more of it. And for performance, this is correct, because you don't execute useless unneeded instructions. The problem, of course, is that in the security realm, coding to break the loop as soon as the answer is known wrong is what provides these types of side channel attacks. But since 99.9% of programmers also do not write code for these environments when tasked to do so they just do what they are used to doing everywhere else (break early, when you know you are done with the checks) without realizing they are leaving an unlocked backdoor as a result.
- yock 10y agoThis was somewhat famously broken in Java until late 2009: https://codahale.com/a-lesson-in-timing-attacks/ https://codahale.com/a-lesson-in-timing-attacks/ tl;dr, the method for doing "secure" string comparison was vulnerable to timing attacks for much of Java's history.
- jamiesonbecker 10y agoExactly. If you're doing something like: if hashing_function(unknown_pass) == hashed_pass: you're doing it wrong... Instead, use the compare function built into your crypto library, which should hopefully be hardened against timing attacks. In most languages, == and === are not safe against timing attacks.
- cmdrfred 10y agoI never knew that damn. What if I added a random delay of a few ms after I compare them?
- _asummers 10y agoNope! If you run the same input enough times, you can get enough data to be able to subtract the random noise out; the larger random number range, the more times you have to run it. The way to properly combat timing attacks is to write constant time code. Daniel Bernstein has made his career talking about and implementing this class of crypto.
- cmdrfred 10y agoHumor me, I think figured it out, run an identical "testPass()" function first and time it ('password' == 'password' if you will), then simply wait at least that length of time before acting on the result. As a bonus add a random delay after that so adversaries might waste time on isolating the randomness as you describe.
- _asummers 10y agoIf you really want to add some sort of randomness, make it based on the user input. That way your randomness depends on what you send and won't be able to be subtracted out. Or use constant time things (which is hard for the record!) and not have to deal with it.
- SilasX 10y agoWhy would that leak key material? Knowing that you matched a few characters of the hash (based on earlier exit and quicker response time) doesn't tell you that some of the password characters match -- a partially-matching password shouldn't have an relationship to a fully-matching one, right?
- jamiesonbecker 10y ago
- kabdib 10y agoYou might not even need this. The safe I own had two "user" and one "master" slot. Doing a search for documentation of similar models, I found that that some had a second "master" slot with a default factory code. Sure enough, this worked on my own model. I find it easy to believe there are additional unlock codes for use by locksmiths, law enforcement and so forth. I'm not buying another electronic lock any time soon.
- awqrre 10y agoWhich lock that you buy that a locksmith can't unlock?
- xoa 10y ago>Which lock can you buy that a locksmith can't unlock? "Unlock" is the key verb here, and any good safe should have that property to as great an extent as possible within its economic target. There is a critical distinction to make between the ability to "unlock" something and the mere ability to "gain access" it. While both ultimately yield up whatever is being protected, part of the core concept of "unlocking" is that it's non-destructive and trivially reversible, and thus to some extent provides some of the services of checksumming to the real world. It's not merely about preventing unauthorized access, but knowing about unauthorized access that couldn't be prevented. Any decent locksmith should be able to access any standard safe (that's their whole job) without any keys, but for a good safe that should require physical bypass (such as drilling, mechanical or energetic application, etc) to be involved, which will leave marks. In a legitimate scenario that's fine, because legitimate scenarios (including the government getting a warrant in an investigation) are not covert. As always in security an adversary with access to and willingness to use sufficient resources may be able to figure something out, but to point is to make that a bar sufficient to whatever level that situation needs. If an electronic lock makes it trivial though to not merely gain access, but for non-owners to "unlock it", ie., to access with a speed and transparency equivalent to that of a legitimate operator, then that is actually a different and more concerning threat profile no matter what the case. As another example, it's certainly hardly an unknown threat that somebody could trivially smash the windows on a typical car to gain access to the interior. But that doesn't mean someone shouldn't be concerned if a newer car with an electronic lock can be trivially made to unlock in a way that's indistinguishable from the owner. There is a risk/reward economic difference that in turn changes the security threat profile.
- zeveb 10y agoThat's a neat attack, but why does anyone get an electronic safe in the first place? The batteries may die, which means there must be a physical lock as well. Either the physical lock is less secure than the electronic lock (in which case an attacker will focus on the physical lock) or it is more secure than the electronic lock (in which case why not rely on the physical lock?). That doesn't even begin to get into the fact that the profession of electronic locksmithing is still in its infancy and as a result electronic locks tend to be laughably insecure in the first place. The whole reason to have a safe is to keep things … safe. Why pay all that money and get nothing in return?
- wlesieutre 10y agoPut a DC barrel jack on it?
- semi-extrinsic 10y agoI see you're downvoted, but I know Yale's residential electronic door locks [1] have a 9V battery terminal on the outside, such that you can open the door in case of an extended power outage. (For short outages the lock has a small internal battery.) [1] http://www.yale.co.uk/en/yale/couk/productsdb/smart-locks/Keyfree-Connected-Smart-Lock/ http://www.yale.co.uk/en/yale/couk/productsdb/smart-locks/Ke...
- andrewla 10y agoFrom reading the underlying article, it is apparent that the power source is externally available (since they monitored power consumption). Looking at the instruction manual [1] confirms this; you do not need to open the lock to change the battery. So there is no mechanical lock fallback. The fact that you can remove the batteries (and even the number pad) without unlocking the safe does seem to present some DoS attacks, but I assume that isn't a major concern. [1] http://www.sargentandgreenleaf.com/pdf/630-302_6120_op.pdf http://www.sargentandgreenleaf.com/pdf/630-302_6120_op.pdf
- crucini 10y agoThe key bypass is only on the cheapest consumer safes. Many of those can be opened just by rapping with a hammer. This vuln was found in Sargent & Greenleaf locks. These are UL-listed locks suitable for securing cash in commercial establishments. They have no key bypass. These locks have the batteries outside the safe, so there is no dead battery issue. However, this enables easy current measurements, as the hacker showed. FYI, at this level there are no "electronic safes" - just regular safes with electronic locks, which have the same form factor as mechanical safe locks. Why an electronic lock? Much faster to enter the combo, proof against robo-dialers, can maintain an audit trail of multiple employees, can issue different combinations to different employees and revoke access.
- EvanAnderson 10y agoDavid Jones' EEVBlog had an episode attempting to do powerline analysis of an electronic safe: https://www.youtube.com/watch?v=HxQUKAjq-7w https://www.youtube.com/watch?v=HxQUKAjq-7w Like other commenters here I'm wary of using an electronic lock because I'm not able to inspect the code for backdoors. I wonder if there's enough of a hacker market to warrant creating a crowdsourced electronic safe (or retrofit of the electronics of an existing electronic safe).
- cmdrfred 10y agoI'd like to see an opensource deadbolt.
- sctb 10y agoWe updated the link from https://www.schneier.com/blog/archives/2016/08/hacking_electro.html https://www.schneier.com/blog/archives/2016/08/hacking_elect..., which points to this.
- peterwwillis 10y agoI didn't read the article, but is the lock RF shielded? Also, slides show a 1/4" hole, and then the lock and an EEPROM; could it be feasible to melt plastic enough through this hole that one could then expose and flash the EEPROM with UV, resetting it?
- teuobk 10y agoThe 1/4" hole is in the steel of the safe door, and then behind that is the hardened steel body of the lock-proper, so no, I don't think that would be feasible.
- jdeeny 10y agoAn EEPROM (Electrically Erasable Programmable Read Only Memory) is erased electrically rather than with UV light like an EPROM. Even if there isn't a possible attack with light, there might be a way to alter the contents of the EEPROM if you can manage some amount of control over the signals entering the IC.
- teuobk 10y agoIt turns out that part of the attack does exactly that. It was glossed over in the Wired article, but the slides describe how the lockout-penalty feature in the lock was defeated by manipulating the EEPROM. Basically, if you kill power to the lock at just the right time (i.e., midway through the EEPROM erase cycle as part of the larger/longer EEPROM write cycle), those bytes in EEPROM will be left with a value of 0 instead of whatever had been there.
- gsmethells 10y agoAn electronic lock will not be on my home anytime soon. Mechanical inventions have nice properties like locality (no remote unlock), history (they've been through the war), and physics (bank vault vs bathroom lock).