← Back to team overview

ecryptfs team mailing list archive

[Bug 345544] Re: ecryptfs stores ram contents in plaintext in the container as padding

 

** Attachment added: "[PATCH] eCryptfs: Allocate a variable number of pages for file headers"
   http://launchpadlibrarian.net/24132752/0001-eCryptfs-Allocate-a-variable-number-of-pages-for-fi.patch

-- 
ecryptfs stores ram contents in plaintext in the container as padding
https://bugs.launchpad.net/bugs/345544
You received this bug notification because you are a member of eCryptfs,
which is a direct subscriber.

Status in eCryptfs - Enterprise Cryptographic Filesystem: Confirmed
Status in “ecryptfs-utils” source package in Ubuntu: Confirmed

Bug description:
Environment: 
Linux flst61nb 2.6.28-gentoo-r2 #4 SMP Tue Mar 17 12:38:43 CET 2009 x86_64 Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz GenuineIntel GNU/Linux

When looking at the contents of the encrypted files I see random content of my System RAM. 
Including the content of ~/.ssh/known_hosts, firefox Cache (html page headers) etc.

It seems ecryptfs fails in padding the files, it even seems that the padding is done after encryption.

To reproduce: 
# mkdir ecryptfs_base
# sudo mount -t ecryptfs ecryptfs_base ecryptfs_base
# cd ecryptfs_base/
# for ((i=0;i<10000;i++)); do dd if=/dev/zero of=$(date +"%s-$i") bs=1 count=1 >/dev/null 2>&1; done
# cd ..
# sudo umount ecryptfs_base/
# strings ecryptfs_base/*

Most of the files contain the String _CONSOLE, some contain just filenames, some the contents of random files.

An attacker with access to the underlying filesystem thus can find random data of the system using ecryptfs lying around in plain inside the files.

I also found the contents of /etc/mtab in some of the files...

/tmp/ecryptfs_base /tmp/ecryptfs_base ecryptfs rw,ecryptfs_sig=90fe7cccfdb1a0ba,ecryptfs_cipher=aes,ecryptfs_key_bytes=16 0 0

so one can find out which key was used to mount the fs

In addition I think there could also be private data of privileged processes run by root in some of the files, so an attacker could use ecryptfs to read (kernel?) memory and might find a password or similar.



References