Flush+Reload: a High Resolution, Low Noise, L3 Cache Side-Channel Attack [pdf]
eprint.iacr.org
eprint.iacr.org
The attack is against the RSA implementation specifically. Is there a gpg asymmetric encryption that would be considered safe? If not, is there a reasonable gpg alternative?
"Furthermore, as virtual machine hypervisors transparently share memory pages between VMs [5,19], the attack is applicable across the isolation layer between VMs"
It's saying your VMs aren't safe - your Amazon/Linode/Rackspace/DigitalOcean/NineFold/Hertzner cloud instances _do_ have arbitrary users running arbitrary code on them – and the hypervisor can't protect you against what they do (in terms of manipulating the shared cache).
There have been cache side-channels demonstrated against some AES implementations, but this attack requires some bit of code whose "execution-or-not" (for lack of a better term) reveals some information the user would like to keep secret.
It is actually very worrying, since it might affect compression software (leak info about the file being compressed), text editors and other software that executes code based on key presses (cross-user keylogger), code whose execution depends on mouse actions e.g. button hover/click events (track another user's mouse), and so on.
Essentially, it turns all "if", "while", and "for" statements into information leaks.
I've written more about it here:
GnuPG 1.4.14 released
What's New
===========
* Mitigate the Yarom/Falkner flush+reload side-channel attack on
RSA secret keys. See http://eprint.iacr.org/2013/448
Edit: and Libgcrypt 1.5.3 contains fix for GnuPG 2.xWhat is to stop creating a statically linked build of GPG, create a new user account, chmod 0700 the new uid's homedir, copy the new binary into the private user account, and perform all your encryption work in there.
So long as you're not running on a VM using tech like kernel samepage merging, pages from the binary should never be shared
I am on Ubuntu LTS 12.04 with GnuPG 1.4.11 (Linux version 3.2.0-32-virtual (buildd@batsu) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)).
Q1. Do I need to fix this potential attack?
Q2. Assuming this fix is not backported [now] - if I compile fresh gpg and swap the binary with the old gpg - will this fix it?
Q2: Cleanest would be to uninstall GnuPG and install latest from source. Make sure to backup relevant directories containing GnuPG related data (probably in your home - sorry I'm not familiar with Ubuntu)
FYI - Debian unstable (aka sid) has a pacakge, and there is a backport to Ubuntu Saucy. I'm not sure what the best/easiest way to automatically pull down sources for a newer release than the release you're running in Ubuntu (there might be some apt-add magick for source mirrors?) -- but since it is up at launchpad[1], you can:
a) try the binaries b) build the debs yourself (aka manually "backport"):
mkdir tmp/gnupg -p
cd tmp/gnupg
sudo apt-get build-dep gnupg
sudo aptitude install dpkg-dev #This might get pulled
#in by the line above
wget https://launchpad.net/ubuntu/saucy/+source/gnupg/1.4.14-1ubuntu1/+files/gnupg_1.4.14.orig.tar.gz \
https://launchpad.net/ubuntu/saucy/+source/gnupg/1.4.14-1ubuntu1/+files/gnupg_1.4.14-1ubuntu1.debian.tar.gz \
https://launchpad.net/ubuntu/saucy/+source/gnupg/1.4.14-1ubuntu1/+files/gnupg_1.4.14-1ubuntu1.dsc
tar xzf gnupg_1.4.14.orig.tar.gz
cd gnupg-1.4.14
tar xzf gnupg_1.4.14-1ubuntu1.debian.tar.gz
cd debian
dpkg-buildpackage
cd ..
sudo dpkg -i gpgv_1.4.14-1ubuntu1_amd64.deb \
gnupg_1.4.14-1ubuntu1_amd64.deb \
gnupg-curl_1.4.14-1ubuntu1_amd64.deb
Note: This might not be a good idea with a package that is as imprtant
as gnupg (among other things apt package lists are signed with gnupg!).
And as you can also see above, the packages are not signed (explicitly,
even if they do come in via https...).At least this built fine under wheezy -- but I haven't tried installing them (I'm not that worried that someone will snoop my workstation cache..).
So not really meant for advice on how to get an upstream gnupg -- but useful with a few other well-behaved programs. So big warning, practice safe hex and all that!
"Flush+Reload is a cache side-channel attack that monitors access to data in shared pages"
The OS does not allow arbitary programs to share pages with gpg. If you share pages with gpg you can already read the key directly, no need for any side channels.
As far as I can tell the paper is completely pointless, a variant of this fallacy http://blogs.msdn.com/b/oldnewthing/archive/2009/01/21/93533...
I wonder how these attacks would fare against NaCl[1] or Sodium[2], who were designed to be secure against side-channel attacks.
[1]: http://nacl.cr.yp.to
[2]: http://labs.umbrella.com/2013/03/06/announcing-sodium-a-new-...
- You must know the code locations of the instructions that you target exactly. I.e. you will need to get down to the exact cache line of the operation in the compiled binary of the attacked program. They solve this by using a binary with debug symbols, in practice this will be harder as the binary will likely be stripped from debug symbols.
- You can bet that there will be differences in the attack depending on the model of processor, let alone the manufacturer that will make it very hard to generalize this attack, increasing its cost.
I think there are cheaper attacks for criminals/government agencies. Also, as mentioned below it is already mitigated by a GPG fix. But I found the paper quite interesting as I never considered such an attack before.