Cold Reboot Attacks on Disk Encryption 398
jcrouthamel writes "Contrary to popular assumption, DRAMs used in most modern computers retain their contents for seconds to minutes after power is lost, even at operating temperatures and even if removed from a motherboard. Although DRAMs become less reliable when they are not refreshed, they are not immediately erased, and their contents persist sufficiently for malicious (or forensic) acquisition of usable full-system memory images. We show that this phenomenon limits the ability of an operating system to protect cryptographic key material from an attacker with physical access. We use cold reboots to mount attacks on popular disk encryption systems — BitLocker, FileVault, dm-crypt, and TrueCrypt — using no special devices or materials. We experimentally characterize the extent and predictability of memory remanence and report that remanence times can be increased dramatically with simple techniques. We offer new algorithms for finding cryptographic keys in memory images and for correcting errors caused by bit decay. Though we discuss several strategies for partially mitigating these risks, we know of no simple remedy that would eliminate them."
Clear the DRAM? (Score:5, Interesting)
Re:Clear the DRAM? (Score:5, Interesting)
Can't remember the name of 'em, though.
Re:Clear the DRAM? (Score:5, Informative)
Re:Clear the DRAM? (Score:5, Informative)
And while your program may indeed wipe the drive after 10 incorrect guesses, there's one very significant weakness to that proposition: the program must be -running- in order to do so.
So, in this case, the method of attack would be as follows: find someone with a laptop full of information who has it activated in an accessible location. Grab said laptop and remove it to a location where the RAM can be accessed per this hack. Then, after grabbing the key, remove the hard drive, hook it to a system you have control over, and either use the key to open the drive or, if the key is corrupted or incomplete, use the key as input to crack the drive conventionally--bearing in mind that if it is mounted in such a way that your fancy program does not activate, the program cannot erase the drive.
Re:Clear the DRAM? (Score:4, Insightful)
BTW, since you claim to be using (presumably US) government security software, you know that disk formatting or dd if=/dev/zero of=/dev/whatever is not sufficient to unclassify a disk that formerly contained classified material.
Re: (Score:3, Insightful)
And any way you slice it, feeling secure has little to do with being secure (TSA, are you listening?) although I have noticed that people who feel secure are generally at the most risk. Mainly, I suppose, because they don't have the knowledge to properly assess the risks they are accepting. Because if they did
If you want to be as secure as you possibly can, start with the assumption that you'r
Re:Clear the DRAM? (Score:5, Insightful)
Use capacitors (Score:5, Insightful)
Re: (Score:2)
although that would be a brain dead setup to have... i could so see manufactures labeling it a "feature"
Re: (Score:3, Informative)
Re: (Score:3, Informative)
Re:Use capacitors (Score:4, Informative)
Usually what I find is a rare-earth magnet at one end of the voice coil's travel that locks the read heads away from the platter in the absence of voltage in the coil; this is aided as well by the torque exerted on the armature by the trace ribbons that feed voltage to the coil and read heads. Note that this magnet is separate and distinct from the two that control the lateral motion of the read/write armature.
The 'clink' that you hear is the armature knocking up against the magnet. If you take the cover off, you can recreate the sound yourself, even without power.
protip: HDD voice coils make great crude galvanometers.
-b
Memory is reliably addressed; just wipe it. (Score:5, Interesting)
What's more of a problem is: how to make this timeout+prompt for passphrase thing work with disk-level encyption regardless of whether you're a console or in a GUI, on an otherwise decent OS like unix? I wouldn't trust Windows to implement disk-level encyption safely anyway, so all bets are off there. But unix still has serious issues regarding the simple presentation of a dialog box to the user no matter what part of the system they're looking at, in a reliable and secure way.
Secure DRAM (Score:2)
Re:Secure DRAM (Score:5, Informative)
Re: (Score:3, Interesting)
Re: (Score:2)
Re:Clear the DRAM? (Score:5, Insightful)
That being said, some sort of physical security mechanism probably wouldn't be out of the question for scenarios that actually called for it. For instance, on systems that contain highly sensitive data such as nuclear launch codes or some such, I could envision a tripwire type system on the computer case that detonates shaped charges on the HD and RAM when the case is cracked. This does open up a possible DOS attack vector, but the alternative seems to justify it.
Re: (Score:3)
I hear things like this a lot, and I disagree. The key words in the quote above are "adequate" and "nothing", which depend on a cost-benefit analysis. Just reducing risk can be more cost-effective than eliminating risk. Encryption is often an adequate software solution to a hardware security problem because
Re:Clear the DRAM? (Score:5, Insightful)
Re:Clear the DRAM? (Score:5, Informative)
As long as we can keep the key hidden, the encryption will protect our data.
Re:Clear the DRAM? (Score:5, Interesting)
I do not thin' it means what you thin' it means. (Score:5, Informative)
I think the word you're looking for is "tenet [merriam-webster.com]".
Re: (Score:3, Informative)
Re:Clear the DRAM? (Score:4, Funny)
Re: (Score:3, Interesting)
Re: (Score:3, Informative)
Because the OS has control of the system at that point. If the terminal is locked, even though the system is on, you won't be able to access anything until you get control of the hardware away from the OS. Also, when you start poking around on a system, you always have the potential of accidentally destroying evidence, and evidence is much weaker in court if there isn't an untampered version of the d
Re: (Score:3, Interesting)
Re: (Score:3, Insightful)
Really, though, who would this affect? Top secret government stuff. I bet they've just got vials of acid or explosives or something. Tamper with the case and the contents (and maybe you) go bye-bye.
Re:Clear the DRAM? (Score:5, Interesting)
Re:Clear the DRAM? (Score:5, Interesting)
Re:Clear the DRAM? (Score:5, Funny)
Well, who wouldn't?
Re:Clear the DRAM? (Score:5, Interesting)
Re: (Score:2)
Re: (Score:2)
Workaround: yank the DIMMs while the system's on.
Re: (Score:2)
Macbook Air... (Score:5, Funny)
has the RAM soldered in the motherboard! I knew Apple was thinking of our security all along!!!
/*ducks*/
Re: (Score:2)
Re:Clear the DRAM? (Score:5, Funny)
Re: (Score:2)
It is easy to write scripts that do anti-forensic stuff on logon/logoff or startup/shutdown. Even pulling the plug [indocomp.com] is often not enough to freeze a system from doing stuff so that you can gather evidence.
Re: (Score:2)
Re: (Score:3, Informative)
The only way I see it to be sure, DRAM upon losing power uses on-board capacitor to erase its own contents, the feature built into the RAM die. Even BIOS is not sufficient if you just pull the plug and move the RAM to a different PC.
Physical Access (Score:3, Insightful)
1) They have your desktop computer
2) It is on
3) You've entered your crypto keys
Is it me or is this just a little tenuous? In a data centre they'd have to drag the thing off the rack and on your personal machine they'd have to physically take it off you, because waiting for you to shutdown and then walk-away would be too long. So the solution is to shutdown the machine and THEN put your coat on and pack your bag.
I can also get people's Crypto keys by threatening them with a knife or putting a CCTV camera over their workstation. There are "easier" ways to get the keys if you have physical access to the environment that are much simpler and reliable.
Re:Physical Access (Score:5, Informative)
Re:Physical Access (Score:5, Insightful)
Like when your laptop is stolen while it's in sleep mode. This is rather a common situation.
Re: (Score:3, Interesting)
3) You've entered your crypto keys
These two are likely true for every kind of whole-drive encryption, unless the encrypted drive is unmounted every time you walk away. As for 1), it's true if you lock the console and walk away from the computer, which quite a lot of people do.
Best workaround would be for A) operating systems to support fixing keys in a single spot in memory and B) drive encryption systems to automatically unmount and scramble the key (in the same place its always been, rather th
Re:Physical Access (Score:5, Informative)
Except, apparently, it didn't. With the new scenario, the thief takes the cover off the machine and then pulls the battery. They then cool the RAM chips and dump the contents. They can then scan through the dump looking for the decryption key. Once they've found it, they mount the encrypted volume from another OS and get at all of your confidential data.
You can probably read the memory via Cardbus! (Score:3, Interesting)
Re:You can probably read the memory via Cardbus! (Score:5, Informative)
Re: (Score:3, Insightful)
Re: (Score:2)
You're going to turn it on later, right?
Let's say you've taken your disk-encrypted laptop home and you're doing work on it. Thugs break in, throw flash grenades, yell, etc. You cut power to your laptop just before they grab it... they rip it open, freeze the contents, then pop out the drams. They put the drams in another machine and read your key, and thus have access to your hard drive. Damn. And you thought turning it o
Physical Access (Score:2)
Re: (Score:2)
from an attacker with physical access (Score:4, Insightful)
CPU cache? (Score:2)
I would hope that the CPU could clear this cache as it powers down (even in a non-orderly manner).
Then again, I realise that people who aren't experts (and I'm definitely not an expert) very rarely make suggestions which actually fix significant security hole
Re: (Score:3, Interesting)
Firewire and USB can access memory (Score:5, Interesting)
I wrote a small paper here http://www.friendsglobal.com/papers/FireWire%20Memory%20Dump%20of%20Windows%20XP.pdf [friendsglobal.com] for a forensics class on using firewire to access memory, subverting the operating system.
All bets are off once physical access is gained. Best bet would be to store the keys, somehow, in the CPU's caches and never let it stay in main memory.
guess what (Score:2)
all security does is build a wall. someone can always climb over it, somehow. the question for you is merely do you want a white picket fence? or do you want a 10 foot chain link fence with barbed wire on top?
locks on doors merely keep honest people honest. anyone determined to break into your house will find a way
don't invest your energy in a failed concept: i can have absolute security. you can't, it's always an arms race, forever
Re: (Score:2)
Additionally, it might be good to remember that the PC architecture has a lot to do with the options you have for securing the machine. If your CPU allows physical separation of user memory and machine use memory there are more options. In fact, you can build a kind of sandbox for the machine to run inside of in a protected way. If your encryption is hardware based, it's possible to p
It rather depends... (Score:3, Interesting)
Is that absolute security? Well, an outsider couldn't break the encryption. To do so requires the pad. There are no
Very real concern (Score:5, Interesting)
However, for grins one day, I decided to run "dd if=/dev/mem bs=1m count=[mem size] | strings | grep [whatever]" and found not only various passwords, but URLs for sites visited *weeks* ago, even after reboots. So, I installed the "secure_delete" port and ran "smem". No luck -- some stuff got wiped, but some remained in memory. So I booted to a memtest86 CD-ROM, and ran the full test (this test does all kinds of writes/reads to memory). Then, I booted *back* to the normal system, and I was *still* able to recover juicy bits from /dev/mem. WTF?
We need a kernel module for the common OSes that can encrypt virtual pages (is that the right term?) so that whether in core or paged, they won't be vulnerable.
Re:Very real concern (Score:5, Informative)
Re: (Score:3, Interesting)
It's pretty easy to tell, though, that if you do my procedure and grep for "example" then see "http://www.example.com" in the result, which hasn't been visited in weeks/days (even after reboots and power-downs), then it's clearly appears to be lingering in RAM.
Someone mentioned browser cache, but that's set to be cleared each time Firefox is loaded. Perhaps file system slack space is the culprit here.
Someone else mentioned the VFS cache, which I don't know
I can't believe this hasn't been mentioned... (Score:3, Insightful)
we know of no simple remedy that would eliminate them...
As part of a secure programming course I recently took, we were instructed to overwrite keys with zeros when done using them. It's that simple - you don't leave the key in memory for any longer than you need it.
When the machine is powered down, your application's exit routine zeros all of the memory, and then free()s it. Nothing that good programming practices can't address.
Generally speaking, it's the keys on the disk(!) that are the problem. Without two factor authentication, you need merely to scan disk sectors...
Re:I can't believe this hasn't been mentioned... (Score:4, Insightful)
Unless of course the machine is, you know, simply "powered down".
Pulling the plug isn't going to let your application do squat.
Re: (Score:3, Insightful)
Re: (Score:3, Interesting)
Countermeasure here: (Score:5, Interesting)
It's not possible to "clear the DRAM" (as others have suggested), because the attacker will boot his own CD and not give control to your OS after the reset. Thus you won't be able to clear anything.
Anything? Not so quick, my dear! For the CD to boot, first there is the BIOS. And BIOS needs memory as well (for the menus, the screen, the ElToro floppy image etc).
Now the countermeasure is obvious: Keep the sensitive key material in memory areas that is erased during the early boot procedure. Then the attack complexity is raised from "no hardware required" to "specicialists hardware necessary, no guarantees given".
It might seem difficult to find out which memory is of that category. But it isn't, either! Just prepare two boot CDs. One that fills all memory with a known pattern (eg 0x55). Boot it. Then reset and insert the second CD, which identifies all memory areas that have lost the known pattern. These areas have either suffered DRAM fade, or they have been overwritten during the BIOS boot process. Use heuristics to find out which of the two was the cause. Done!
As simple as that.
Regards,
Marc
Re: (Score:2)
Anything? Not so quick, my dear! For the CD to boot, first there is the BIOS. And BIOS needs memory as well (for the menus, the screen, the ElToro floppy image etc). Now the countermeasure is obvious: Keep the sensitive key material in memory areas that is erased during the early boot procedure. Then the attack complexity is raised from "no hardware required" to "specicialists hardware necessary, no guarantees given".
I'm pretty sure you can manufacture a specialist DRAM read/dump module for a tens of dollars in China. So while it would be for specialists, access to such hardware will be available and at relatively low costs. So it won't stop the people you're trying to protect your from.
Dirty fix (Score:2, Insightful)
Password the BIOS, boot only from local disk.
Already Screwed (Score:4, Interesting)
And aside from that, couldn't you just encrypt the important parts of your memory and swap as well as your hard drive? Seems like that would defeat this quite handily, and again, if I were doing something so sensitive I'd probably be taking such precautions.
Honestly though, aside from people doing stuff like maybe international or corporate espionage, I can't imagine where any of this would be a problem.
New feature for motherboard venders (Score:2, Interesting)
In 1986... (Score:2)
I pulled a PIC-4 uP out from a circuit. The DRAM stayed non-refeshed for 2 minutes...
Well known problem to security experts... (Score:2)
Fix: None, really. Just don't overestimate the capabilities an attacker needs to get your data. Also note, that if a computer has been switched off for some time, the risk fades. Protecting laptop disks with disk encryption is not a lot less secure now and still a good idea.
Fix: install BIOS with a memory test. (Score:4, Interesting)
Easy fix: install a BIOS/boot ROM with a non-bypassable memory test of all memory. This will clear all memory at power-up before reading the boot device.
Put the key in SRAM. (Score:3, Interesting)
Put the key in a small piece of SRAM. When it gets used to encrypt something, be sure the place of its usage gets wiped back off real fast to minimize the chance of it being exposed to the cold attack. Split data up with different keys for different data, so if a key is exposed, only a minimal amount of data is lost. Another option is to double or triple encrypt the data being sure never to have more than one key at a time in DRAM.
So where do we get this SRAM? A CPU register that is not used, and not saved, for any current purpose is one possible place. For a large amount of SRAM, check out your video card buffer.
Simple fix, no? (Score:4, Insightful)
Wait, doesn't it already?
Wait, did the researchers bypass BIOS?
Well, if they did, then adding some crap to DRAM to kill it on power loss is the only way. Probably.
It was once an axiom of system security, that if you gained physical access, all was lost. This evolved from keyboard and console attacks to floppy- and CD-boot attacks, USB keys, stealing the hard drive, you know the drill.
Ultimately, if you can cart away pieces of the machine, your last line of defense is gone.
The only other variable to control is time. Make the DRAM die quicker, or is it time for a 'better' memory technology?
And this is such great stuff, the TEMPEST guys will now have to re-write their procedures, with both a power-off and wait 30 seconds, and a re-power-on and wait for login prompt, then shutdown again.
Sometimes I hate h@xrs, and sometimes I realize they do me a service, albeit while they intend to just do me.
How ironic. My captcha is 'honest'. This cannot be coincidence.
DRM attack vector (Score:5, Insightful)
This is pretty epic... (Score:4, Insightful)
Another attack loop-AES thought about ! (Score:5, Interesting)
This is yet another attack that the developer of loop-AES [sourceforge.net] thought about while typically every other disk encryption tool out there is vulnerable. Loop-AES is the 3rd most popular disk encryption tool in Linux. See the KEYSCRUB=y option in its README file [sourceforge.net]:
I have used loop-AES as a full disk encryption tool on my laptop for 2+ years. I am glad I took the time to carefully research which tool would the most secure before deploying it ! For example even TrueCrypt and dm-crypt are vulnerable to other (arguably minor) security issues that loop-AES is impervious to: http://article.gmane.org/gmane.linux.cryptography/2321 [gmane.org]
Surprisingly, the research paper TFA talks about doesn't even directly mention loop-AES (its name only happens to be in the title of a webpage in the reference section describing a safe suspend/resume setup when using disk encryption).
Re: (Score:3, Informative)
Re: (Score:3, Informative)
I'm afraid it doesn't. Here is the code from Gutmann's paper:
Flipping:
Epoxy (Score:3, Insightful)
It seems like the best defense would be applying epoxy to the memory so it couldn't be removed from the slot. If you make sure all the connections are covered as well, they wouldn't be able to place a tap, either. (At least without a lot of time being spent slowly drilling through the epoxy.)
It would make it impossible to replace your memory, but you could always move the HD to another system. If you care that much, then you should be willing to pay for a new system if someone tries to compromise your data.
Sony IBM Cell (Score:5, Interesting)
The first power word that a toddler learns is "mine!" It's the capstone to a complete working vocabulary: mommy, daddy, more, enough, and mine. My laptop, my hardware, my data, my privacy. The word "mine" has a direct bypass to the neurological circuit "you can't make me", which as adults lingers as a deeply-rooted fascination with rubber-hose cryptography, and bravado propositions such as "if the Feds bust through your windows". Wrong answer.
Let's look at this from Sony's perspective: my media, my hardware, my design, my copyright, my profits. But guess what? They have a small physical access problem. Millions of zit faced kids with access to liquid nitrogen can get their paws inside the PS3.
This is why an entire SPU is locked down on the PS3 for security / DRM purposes. The SPU contains 256K of SRAM which is carefully guarded. The instruction set is synchronous and deterministic to guard against timing attacks. They were aware of power attacks as well. These can be partially mitigated in software for critical routines by executing non-conditional instruction sequences and then discarding the portions of the computation you didn't want. By design, the SPU doesn't dance on the power line the way most modern speculative out-of-order processors do to begin with. You can't use latency effects, because the local SRAM has constant access time. You can't use contention effects because there aren't any below the level of DMA bursts, which are controlled by a companion processor within the SPU. Plus I think it is possible to schedule SPU-SPU and SPU-memory DMA transfers deterministically, if you really need to. None of this was accidental.
The hardest part of the problem is bootstrapping the secure SPU with the security kernel. I've forgotten how they went about it. There must be some kind of decrypt key buried in the Cell hardware which functions during initial code upload during processor initialization.
In the long run it might be an unwinnable battle, but the PS3 certainly has a far better facility to maintain data security in the complete absence of hardware security than your average PC.
Why can't the average hacker Harry wants to enjoy the same security as Sony/IBM, why can't you achieve this? You've already got the PS3 in your living room. Impediment: the secure system init decrypt key is probably burned into the silicon. It's probably a one-way key, so even if you crack the key, you won't be able to encrypt a replacement block of your own code that matches the decrypt key. But let's suppose you break that too. Problem: Sony knows the decrypt key for the SPU initialization sequence. Game over.
Let's suppose you figure out how to physically change the silicon with an initialization decrypt code known only to yourself. Congratulations, you now enjoy the same protection for your secrets that Sony enjoys for "Untraceable". In doing so, you have now upgraded yourself to a sufficiently threatening fish to swim in a tank in Syria, where your nervous system will be similarly reconfigured.
Ew, I feel like I've just written the script for "Adaptation".
Countermeasure: VIA C3 has built-in SRAM (Score:5, Interesting)
Newever VIA processors also have some hardware AES support available under Linux, which they call "Padlock. So, if they still retain the SRAM feature, then, at that would make a pretty good choice for the little fanless mini-ITX Linux box that receives your email.
Re: (Score:2, Interesting)
The method strikes me as the best way to get past TPM devices, until they include measures to zero all RAM on shutdown.
Re: (Score:3, Insightful)
You are making several wild assumptions here (Score:2)
a) Your average cop who is seizing your PC is well-read enough to know about this technique
b) The cops came totally unannounced to you
c) Your PC is left on all the time with your encrypted partition mounted, or that the cops moved through your house so fast (30 seconds according to the article) that you don't have enough time to turn the machine you are using off for long enough for the DRAM to lose it's charge.
d) You don't have a BIOS boot password set on the PC (any BIOS password w
Re: (Score:2)
Re: (Score:2, Informative)
Re: (Score:2, Insightful)
Re: (Score:2)
Re:Fascinating... (Score:5, Informative)
Re:Fascinating... (Score:5, Informative)
I ran those tests because we were using a large chunk of SDRAM (16MB) as a RAM disk to capture log data on an embedded platform. On system failures we had the logs that led to the failure plus a small crash dump to support debugging. The hardware restart cycle was always fast enough to preserve the RAM disk image. I became curious as to how close we were to the edge, so tried a series of experiments, including extracting the blade from the chassis, watching the sweep hand on my watch, and reinserting the blade to let it boot. Even in a temperature chamber (60C is really warm...) the RAM FS was sane after a four second pack pull, allowing about two seconds for the power management to reboot the pack, that gave a six second power off window.
On reboot, the boot monitor checked the reserved area by clearing the ECC status bits, then reading the entire reserved block, which would trigger ECC counters in the memory controller if there were flipped bits. If there were any (even one) ECC counts, it zeroed the block, triggering the kernel to rebuild an empty file system.
So there is my experience on DRAM data retention in power off situations. YMMV.
If someone would like to try this with DDR2 or DDR3 with ECC, it would be interesting to see your results. I have DDR2/ECC blades coming on line now, if I get ahead of my work, I may recreate this test and post back the results. Given my current calendar, it will be a while (months).
PS: Under normal room temp, ~20C, it was very reliable at 16 seconds, and I saw a couple of tests that passed twenty.
Re:Fascinating... (Score:5, Informative)
At any rate, even with low temperatures, with such delays I'd never count on being able to get 100% of the contents successfully.
Re: (Score:3, Interesting)
I suspect he is.
I remember on my Apple II, when you first turned it on, the screen was filled with inverse '@' symbols. Then the screen would quickly blank (or be replaced by spaces) and the startup sequence would go.
But if it hadn't been off for very long, not all the memory would go to zero (chr$('\0') is the inverse '@'). So, if you turned your computer back on with in a certain time, you could either see the screen it had when it shut off, or more likely, rows of the screen would be inverse '@'s, and
Hardly the problem (Score:2)
Worse, on most running OSes there are all kinds of deallocated and leaked chunks of memory that have god-knows-what in them. As root, you could browse through all this, or just trigger a dump.
This is fun to know, but really, if someone is going to get physical access and rip the RAM out of your machine for its secrets and then plop them into a specially-crafted dead-RAM reader, you've got bigger problems, like the CIA or
Re: (Score:3, Insightful)
Re: (Score:3, Informative)
So simply setting the hard drive as the only boot device in BIOS, and password protecting BIOS could slow down the attacker enough. (they'd have to disasemble the laptop, reset the bios, reboot).
As someone pointed out to me a few days a
Re: (Score:3, Interesting)